Fix for cProfile.

SF patch# 1755176 by Amaury Forgeot d'Arc.
This commit is contained in:
Guido van Rossum 2007-07-16 23:36:05 +00:00
parent d77d6992a5
commit 1c5a98a360
2 changed files with 4 additions and 1 deletions

View file

@ -153,7 +153,7 @@ class Profile(_lsprof.Profiler):
# ____________________________________________________________
def label(code):
if isinstance(code, str):
if isinstance(code, basestring):
return ('~', 0, code) # built-in functions ('~' sorts at the end)
else:
return (code.co_filename, code.co_firstlineno, code.co_name)