diff options
| author | Raymond Hettinger <python@rcn.com> | 2009-01-27 10:03:04 (GMT) |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2009-01-27 10:03:04 (GMT) |
| commit | ecf252abac71be8bcf7c4daa8f3a8ca6acd15b0c (patch) | |
| tree | a1ed4590cf6de37cedffbdae04d0ad6d6a91f824 /Lib/collections.py | |
| parent | f93f3032c63906d0a6516d6e75985f0d425f36f5 (diff) | |
| download | cpython-ecf252abac71be8bcf7c4daa8f3a8ca6acd15b0c.zip cpython-ecf252abac71be8bcf7c4daa8f3a8ca6acd15b0c.tar.gz cpython-ecf252abac71be8bcf7c4daa8f3a8ca6acd15b0c.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 effae7d..0fddb97 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -109,7 +109,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 |
