Skip to content

Commit

Permalink
Don't loop forever at the end of input SQL file
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed May 5, 2024
1 parent 1394845 commit 10e8fb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pgtricks/pg_dump_splitsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def new_output(filename: str) -> IO[str]:
with open(sql_filepath) as sql_file:
while True:
line = sql_file.readline()
if not line:
break
if sorted_data_lines is None:
if line in ('\n', '--\n'):
buf.append(line)
Expand Down

0 comments on commit 10e8fb8

Please sign in to comment.