1
1
mirror of https://github.com/yandex/pgmigrate.git synced 2024-11-13 00:14:22 +03:00

Fix migration error with comment at the end of file

This commit is contained in:
Vladimir Antipin 2017-04-06 01:14:17 +03:00 committed by secwall
parent bac96be3e4
commit 20633e6dde

View File

@ -315,6 +315,7 @@ def _get_statements(path):
raise MalformedStatement(
'Non ascii symbols in file: {0}, {1}'.format(
path, text(exc)))
data = sqlparse.format(data, strip_comments=True)
for statement in sqlparse.parsestream(data, encoding='utf-8'):
st_str = text(statement).strip().encode('utf-8')
if st_str: