Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7ce86d

Browse files
committed
Patch from Zooko to remove an experimental feature.
1 parent 7cb229d commit d7ce86d

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

Lib/trace.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,11 @@ def __init__(self, counts=None, calledfuncs=None, infile=None,
198198
self.infile = infile
199199
self.outfile = outfile
200200
if self.infile:
201-
# Try and merge existing counts file.
202-
# This code understand a couple of old trace.py formats.
201+
# Try to merge existing counts file.
203202
try:
204-
thingie = pickle.load(open(self.infile, 'r'))
205-
if isinstance(thingie, dict):
206-
self.update(self.__class__(thingie))
207-
elif isinstance(thingie, tuple) and len(thingie) == 2:
208-
counts, calledfuncs = thingie
209-
self.update(self.__class__(counts, calledfuncs))
210-
except (IOError, EOFError), err:
203+
counts, calledfuncs = pickle.load(open(self.infile, 'r'))
204+
self.update(self.__class__(counts, calledfuncs))
205+
except (IOError, EOFError, ValueError), err:
211206
print >> sys.stderr, ("Skipping counts file %r: %s"
212207
% (self.infile, err))
213208
except pickle.UnpicklingError:

0 commit comments

Comments
 (0)