diff options
author | Raymond Hettinger <python@rcn.com> | 2009-01-27 10:06:09 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-01-27 10:06:09 (GMT) |
commit | 0f05517d85efcce6fc57cec63ec54a4612ee5382 (patch) | |
tree | 9bdba0b7260d9c587f0ab69d12c6e89cf72396e6 /Lib/collections.py | |
parent | d17ad8d6386c446763554d61d777ee65ea68e97a (diff) | |
download | cpython-0f05517d85efcce6fc57cec63ec54a4612ee5382.zip cpython-0f05517d85efcce6fc57cec63ec54a4612ee5382.tar.gz cpython-0f05517d85efcce6fc57cec63ec54a4612ee5382.tar.bz2 |
Issue 5021: doctest.testfile should set __name__
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index 6831cf1..4bde5b3 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -111,7 +111,7 @@ def namedtuple(typename, field_names, verbose=False): # where the named tuple is created. Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): - result.__module__ = _sys._getframe(1).f_globals['__name__'] + result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') return result |