(line, comments=None)
return line, comments, new_comments
Removes comments from import line.
Removes comments from import line.
Removes comments from import line .
def _strip_comments(line, comments=None):
        """Removes comments from import line."""
        if comments is None:
            comments = []

        new_comments = False
        comment_start = line.find("#")
        if comment_start != -1:
            comments.append(line[comment_start + 1:].strip())
            new_comments = True
            line = line[:comment_start]

        return line, comments, new_comments
def _strip_comments ( line , comments = None ) : if comments is None : comments = [ ] new_comments = False comment_start = line . find ( "#" ) if comment_start != - 1 : comments . append ( line [ comment_start + 1 : ] . strip ( ) ) new_comments = True line = line [ : comment_start ] return line , comments , new_comments