Django

Code

Changeset 7591

Show
Ignore:
Timestamp:
06/08/08 00:38:13 (6 months ago)
Author:
jacob
Message:

Fixed #6394: improved comment stripping in initial SQL files. Thanks, Thomas Guttler.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/sql.py

    r7568 r7591  
    447447            for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)): 
    448448                # Remove any comments from the file 
    449                 statement = re.sub(ur"--.*[\n\Z]", "", statement) 
     449                statement = re.sub(ur"--.*([\n\Z]|$)", "", statement) 
    450450                if statement.strip(): 
    451451                    output.append(statement + u";")