Kaydet (Commit) 102394b7 authored tarafından Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss

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
üst 5675ae44
...@@ -446,7 +446,7 @@ def custom_sql_for_model(model): ...@@ -446,7 +446,7 @@ def custom_sql_for_model(model):
fp = open(sql_file, 'U') fp = open(sql_file, 'U')
for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)): for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)):
# Remove any comments from the file # Remove any comments from the file
statement = re.sub(ur"--.*[\n\Z]", "", statement) statement = re.sub(ur"--.*([\n\Z]|$)", "", statement)
if statement.strip(): if statement.strip():
output.append(statement + u";") output.append(statement + u";")
fp.close() fp.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment