Python 2.6 compatibility fixes.
parent
e95dc5f895
commit
a914ea088c
|
@ -231,11 +231,11 @@ def update_status(**kw):
|
||||||
import json
|
import json
|
||||||
|
|
||||||
if os.environ['OUTDIR']:
|
if os.environ['OUTDIR']:
|
||||||
status = {
|
status = dict(
|
||||||
k: v for k, v in kw.items() if k in [
|
(k, v) for k, v in kw.items() if k in [
|
||||||
'start_time', 'end_time', 'exit_code', 'pid'
|
'start_time', 'end_time', 'exit_code', 'pid'
|
||||||
]
|
]
|
||||||
}
|
)
|
||||||
log('Updating the status:\n{0}'.format(json.dumps(status)))
|
log('Updating the status:\n{0}'.format(json.dumps(status)))
|
||||||
with open(os.path.join(os.environ['OUTDIR'], 'status'), 'w') as fp:
|
with open(os.path.join(os.environ['OUTDIR'], 'status'), 'w') as fp:
|
||||||
json.dump(status, fp)
|
json.dump(status, fp)
|
||||||
|
|
|
@ -470,11 +470,10 @@ def poll(trans_id):
|
||||||
rows_affected = conn.rows_affected()
|
rows_affected = conn.rows_affected()
|
||||||
|
|
||||||
for col in col_info:
|
for col in col_info:
|
||||||
items = list(col.items())
|
|
||||||
col_type = dict()
|
col_type = dict()
|
||||||
col_type['type_code'] = items[1][1]
|
col_type['type_code'] = col['type_code']
|
||||||
col_type['type_name'] = None
|
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
|
# As we changed the transaction object we need to
|
||||||
# restore it and update the session variable.
|
# restore it and update the session variable.
|
||||||
|
|
Loading…
Reference in New Issue