mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	[Bug #550364] Add get_python_version()
This commit is contained in:
		
							parent
							
								
									9a38dcf057
								
							
						
					
					
						commit
						0ff98b9346
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -35,6 +35,14 @@ | ||||||
| del argv0_path, landmark | del argv0_path, landmark | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | def get_python_version (): | ||||||
|  |     """Return a string containing the major and minor Python version, | ||||||
|  |     leaving off the patchlevel.  Sample return values could be '1.5' | ||||||
|  |     or '2.2'. | ||||||
|  |     """ | ||||||
|  |     return sys.version[:3] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| def get_python_inc(plat_specific=0, prefix=None): | def get_python_inc(plat_specific=0, prefix=None): | ||||||
|     """Return the directory containing installed Python header files. |     """Return the directory containing installed Python header files. | ||||||
| 
 | 
 | ||||||
|  | @ -93,7 +101,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): | ||||||
| 
 | 
 | ||||||
|     if os.name == "posix": |     if os.name == "posix": | ||||||
|         libpython = os.path.join(prefix, |         libpython = os.path.join(prefix, | ||||||
|                                  "lib", "python" + sys.version[:3]) |                                  "lib", "python" + get_python_version()) | ||||||
|         if standard_lib: |         if standard_lib: | ||||||
|             return libpython |             return libpython | ||||||
|         else: |         else: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andrew M. Kuchling
						Andrew M. Kuchling