Ticket #2452: management.diff

File management.diff, 628 bytes (added by Pawel J. Sawicki (http://pjs.name), 9 years ago)

Patch that correctly removes any comments presented within any initial sql data files.

  • management.py

     
    349349        if os.path.exists(sql_file):
    350350            fp = open(sql_file)
    351351            for statement in statements.split(fp.read()):
     352                # This regexp ensures that any comments presented within a sql
     353                # statement will be removed.
     354                statement = re.sub(r"--.*[\n\Z]", "", statement)
     355
    352356                if statement.strip():
    353357                    output.append(statement + ";")
    354358            fp.close()
Back to Top