# This module is in the public domain. No warranties.
-__version__ = 'Ka-Ping Yee <ping@lfw.org>, 1 Jan 2001'
+__author__ = 'Ka-Ping Yee <ping@lfw.org>'
+__date__ = '1 Jan 2001'
import sys, types, string, dis, imp, tokenize
def getmodule(object):
"""Try to guess which module an object was defined in."""
if isclass(object):
- return sys.modules[object.__module__]
+ return sys.modules.get(object.__module__)
try:
file = getsourcefile(object)
except TypeError:
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_traceback, context)
+
+