mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Issue #23008: Fixed resolving attributes with boolean value is False in pydoc.
This commit is contained in:
		
						commit
						f5e8540e1b
					
				
					 3 changed files with 11 additions and 1 deletions
				
			
		|  | @ -1588,7 +1588,7 @@ def resolve(thing, forceload=0): | |||
|     """Given an object or a path to an object, get the object and its name.""" | ||||
|     if isinstance(thing, str): | ||||
|         object = locate(thing, forceload) | ||||
|         if not object: | ||||
|         if object is None: | ||||
|             raise ImportError('''\ | ||||
| No Python documentation found for %r. | ||||
| Use help() to get the interactive help utility. | ||||
|  |  | |||
|  | @ -1006,6 +1006,14 @@ class C(metaclass=M): | |||
|         result = output.getvalue().strip() | ||||
|         self.assertEqual(expected_text, result) | ||||
| 
 | ||||
|     def test_resolve_false(self): | ||||
|         # Issue #23008: pydoc enum.{,Int}Enum failed | ||||
|         # because bool(enum.Enum) is False. | ||||
|         with captured_stdout() as help_io: | ||||
|             pydoc.help('enum.Enum') | ||||
|         helptext = help_io.getvalue() | ||||
|         self.assertIn('class Enum', helptext) | ||||
| 
 | ||||
| 
 | ||||
| @reap_threads | ||||
| def test_main(): | ||||
|  |  | |||
|  | @ -15,6 +15,8 @@ Core and Builtins | |||
| Library | ||||
| ------- | ||||
| 
 | ||||
| - Issue #23008: Fixed resolving attributes with boolean value is False in pydoc. | ||||
| 
 | ||||
| - Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't | ||||
|   increment unfinished tasks (this bug was introduced when | ||||
|   JoinableQueue was merged with Queue). | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka