Bug #1603321: make pstats.Stats accept Unicode file paths.
(backport from rev. 52845)
This commit is contained in:
parent
9147f7ed8b
commit
2286441a81
|
@ -116,7 +116,7 @@ class Stats:
|
||||||
|
|
||||||
def load_stats(self, arg):
|
def load_stats(self, arg):
|
||||||
if not arg: self.stats = {}
|
if not arg: self.stats = {}
|
||||||
elif type(arg) == type(""):
|
elif isinstance(arg, basestring):
|
||||||
f = open(arg, 'rb')
|
f = open(arg, 'rb')
|
||||||
self.stats = marshal.load(f)
|
self.stats = marshal.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Reference in New Issue