Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… Thomas Guttler.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 102394b79db9fcbd6dec32a795e0d9d0a90afd11 1 parent 5675ae4
Jacob Kaplan-Moss authored June 08, 2008

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/management/sql.py
2  django/core/management/sql.py
@@ -446,7 +446,7 @@ def custom_sql_for_model(model):
446 446
             fp = open(sql_file, 'U')
447 447
             for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)):
448 448
                 # Remove any comments from the file
449  
-                statement = re.sub(ur"--.*[\n\Z]", "", statement)
  449
+                statement = re.sub(ur"--.*([\n\Z]|$)", "", statement)
450 450
                 if statement.strip():
451 451
                     output.append(statement + u";")
452 452
             fp.close()

0 notes on commit 102394b

Please sign in to comment.
Something went wrong with that request. Please try again.