Python 2.6 compatibility fixes.

pull/3/head
Murtuza Zabuawala 2017-02-08 16:28:04 +00:00 committed by Dave Page
parent e95dc5f895
commit a914ea088c
2 changed files with 5 additions and 6 deletions

View File

@ -231,11 +231,11 @@ def update_status(**kw):
import json
if os.environ['OUTDIR']:
status = {
k: v for k, v in kw.items() if k in [
status = dict(
(k, v) for k, v in kw.items() if k in [
'start_time', 'end_time', 'exit_code', 'pid'
]
}
)
log('Updating the status:\n{0}'.format(json.dumps(status)))
with open(os.path.join(os.environ['OUTDIR'], 'status'), 'w') as fp:
json.dump(status, fp)

View File

@ -470,11 +470,10 @@ def poll(trans_id):
rows_affected = conn.rows_affected()
for col in col_info:
items = list(col.items())
col_type = dict()
col_type['type_code'] = items[1][1]
col_type['type_code'] = col['type_code']
col_type['type_name'] = None
columns[items[0][1]] = col_type
columns[col['name']] = col_type
# As we changed the transaction object we need to
# restore it and update the session variable.