Use older pickle protocol to be compatible with Python versions older than 3.4
This commit is contained in:
parent
027701882a
commit
1a42876521
|
@ -94,7 +94,7 @@ class Manager(threading.Thread):
|
||||||
try:
|
try:
|
||||||
with open(shared.data_directory + 'objects.pickle', mode='bw') as file:
|
with open(shared.data_directory + 'objects.pickle', mode='bw') as file:
|
||||||
with shared.objects_lock:
|
with shared.objects_lock:
|
||||||
pickle.dump(shared.objects, file, protocol=4)
|
pickle.dump(shared.objects, file, protocol=3)
|
||||||
logging.debug('Saved objects')
|
logging.debug('Saved objects')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning('Error while saving objects')
|
logging.warning('Error while saving objects')
|
||||||
|
@ -108,7 +108,7 @@ class Manager(threading.Thread):
|
||||||
shared.unchecked_node_pool = set(random.sample(shared.unchecked_node_pool, 1000))
|
shared.unchecked_node_pool = set(random.sample(shared.unchecked_node_pool, 1000))
|
||||||
try:
|
try:
|
||||||
with open(shared.data_directory + 'nodes.pickle', mode='bw') as file:
|
with open(shared.data_directory + 'nodes.pickle', mode='bw') as file:
|
||||||
pickle.dump(shared.node_pool, file, protocol=4)
|
pickle.dump(shared.node_pool, file, protocol=3)
|
||||||
logging.debug('Saved nodes')
|
logging.debug('Saved nodes')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning('Error while saving nodes')
|
logging.warning('Error while saving nodes')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user