[bugfix] WIP, creating new issue: Could not save project after initializing Event table; PySide2.QTableWidgetItem cannot be pickled!

This commit is contained in:
marcel committed 2021-07-09 15:31:12 +02:00
1 parent de11c3b611
commit aa73bb0ae8
2 files changed
+37 -33

No files matched your search

+6 -6
View File
@@ -296,13 +296,13 @@ class Event(ObsPyEvent):
:rtype: None
"""
try:
import cPickle
import pickle
except ImportError:
import _pickle as cPickle
import _pickle as pickle
try:
outfile = open(filename, 'wb')
cPickle.dump(self, outfile, -1)
pickle.dump(self, outfile, -1)
self.dirty = False
except Exception as e:
print('Could not pickle PyLoT event. Reason: {}'.format(e))
@@ -317,11 +317,11 @@ class Event(ObsPyEvent):
:rtype: Event
"""
try:
import cPickle
import pickle
except ImportError:
import _pickle as cPickle
import _pickle as pickle
infile = open(filename, 'rb')
event = cPickle.load(infile)
event = pickle.load(infile)
event.dirty = False
print('Loaded %s' % filename)
return event