mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Add some comments.
This commit is contained in:
		
							parent
							
								
									7dcbd2c873
								
							
						
					
					
						commit
						8ed677db12
					
				
					 2 changed files with 3529 additions and 3526 deletions
				
			
		|  | @ -1669,7 +1669,11 @@ def __import__(name, globals=None, locals=None, fromlist=(), level=0): | ||||||
|         elif not name: |         elif not name: | ||||||
|             return module |             return module | ||||||
|         else: |         else: | ||||||
|  |             # Figure out where to slice the module's name up to the first dot | ||||||
|  |             # in 'name'. | ||||||
|             cut_off = len(name) - len(name.partition('.')[0]) |             cut_off = len(name) - len(name.partition('.')[0]) | ||||||
|  |             # Slice end needs to be positive to alleviate need to special-case | ||||||
|  |             # when ``'.' not in name``. | ||||||
|             return sys.modules[module.__name__[:len(module.__name__)-cut_off]] |             return sys.modules[module.__name__[:len(module.__name__)-cut_off]] | ||||||
|     else: |     else: | ||||||
|         return _handle_fromlist(module, fromlist, _gcd_import) |         return _handle_fromlist(module, fromlist, _gcd_import) | ||||||
|  |  | ||||||
							
								
								
									
										7051
									
								
								Python/importlib.h
									
										
									
									
									
								
							
							
						
						
									
										7051
									
								
								Python/importlib.h
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon