Commits

ericvsmith  committed 4cd69a1

Continue working if __name__ isn't found in the frame.

  • Participants
  • Parent commits b7aff6a
  • Tags 1.2

Comments (0)

Files changed (2)

File recordtype.py

     #  enviroments where sys._getframe is not defined (Jython for
     #  example).
     if hasattr(_sys, '_getframe') and _sys.platform != 'cli':
-        cls.__module__ = _sys._getframe(1).f_globals['__name__']
+        cls.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')
 
     return cls
 
 
 
 setup(name='recordtype',
-      version='1.1',
+      version='1.2',
       url='https://bitbucket.org/ericvsmith/recordtype',
       author='Eric V. Smith',
       author_email='eric@trueblade.com',