Ticket #6394: sql_comments.diff

File sql_comments.diff, 637 bytes (added by Thomas Güttler <hv@…>, 17 years ago)
  • core/management/sql.py

     
    445445            fp = open(sql_file, 'U')
    446446            for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)):
    447447                # Remove any comments from the file
    448                 statement = re.sub(ur"--.*[\n\Z]", "", statement)
     448                statement = re.sub(ur"--.*([\n\Z]|$)", "", statement)
    449449                if statement.strip():
    450450                    output.append(statement + u";")
    451451            fp.close()
Back to Top