mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Issue 5021: doctest.testfile should set __name__
This commit is contained in:
		
							parent
							
								
									f93f3032c6
								
							
						
					
					
						commit
						ecf252abac
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -109,7 +109,7 @@ def __getnewargs__(self):
 | 
				
			||||||
    # where the named tuple is created.  Bypass this step in enviroments where
 | 
					    # where the named tuple is created.  Bypass this step in enviroments where
 | 
				
			||||||
    # sys._getframe is not defined (Jython for example).
 | 
					    # sys._getframe is not defined (Jython for example).
 | 
				
			||||||
    if hasattr(_sys, '_getframe'):
 | 
					    if hasattr(_sys, '_getframe'):
 | 
				
			||||||
        result.__module__ = _sys._getframe(1).f_globals['__name__']
 | 
					        result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result
 | 
					    return result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,6 +145,9 @@ Core and Builtins
 | 
				
			||||||
Library
 | 
					Library
 | 
				
			||||||
-------
 | 
					-------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Issue 5021:  doctest.testfile() did not create __name__ and
 | 
				
			||||||
 | 
					  collections.namedtuple() relied on __name__ being defined.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Backport importlib from Python 3.1. Only the import_module() function has
 | 
					- Backport importlib from Python 3.1. Only the import_module() function has
 | 
				
			||||||
  been backported to help facilitate transitions from 2.7 to 3.1.
 | 
					  been backported to help facilitate transitions from 2.7 to 3.1.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue