Skip to content

Commit

Permalink
Fix lists and relative imports for Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
laulaz committed May 28, 2024
1 parent 00f6199 commit ebac91b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion imio/pyutils/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

import psycopg2
from system import error, trace
from .system import error, trace

# ------------------------------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions imio/pyutils/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def write_to(out_files, key, line):

def close_outfiles(outfiles):
""" Close the outfiles """
for key in outfiles.keys():
for key in list(outfiles.keys()):
if 'fh' in outfiles[key]:
outfiles[key]['fh'].close()
# verbose("Output file '%s' generated" % outfiles[key]['file'])
Expand Down Expand Up @@ -145,7 +145,7 @@ def read_dictcsv(filename, fieldnames=[], strip_chars='', replace_dq=True, skip_
if '_rest' in row:
error(u'! STOPPING: some columns are not defined in fieldnames: {}'.format(row['_rest']))
return u'STOPPING: some columns are not defined in fieldnames: {}'.format(row['_rest']), []
extra_cols = [key for (key, val) in row.items() if val == '__NO_CO_LU_MN__']
extra_cols = [key for (key, val) in list(row.items()) if val == '__NO_CO_LU_MN__']
if extra_cols:
error(u'! STOPPING: to much columns defined in fieldnames: {}'.format(extra_cols))
return u'STOPPING: to much columns defined in fieldnames: {}'.format(extra_cols), []
Expand All @@ -155,7 +155,7 @@ def read_dictcsv(filename, fieldnames=[], strip_chars='', replace_dq=True, skip_
new_row = {}
if ln_key:
new_row[ln_key] = reader.line_num
for key, val in row.items():
for key, val in list(row.items()):
if replace_dq:
val = val.replace('""', '"')
if strip_chars:
Expand Down

0 comments on commit ebac91b

Please sign in to comment.