diff options
| author | Andrew M. Kuchling <amk@amk.ca> | 2002-11-14 01:43:00 +0000 |
|---|---|---|
| committer | Andrew M. Kuchling <amk@amk.ca> | 2002-11-14 01:43:00 +0000 |
| commit | d47c1f5e8455cc049fc8c4ae2c00795e98c3abb7 (patch) | |
| tree | 16f3ff0883c76c3b4c386b2d901e8456b0c27469 | |
| parent | 649fdd11b8ff8d08957390b343eca0dbc5a9e3a5 (diff) | |
| download | python-setuptools-git-d47c1f5e8455cc049fc8c4ae2c00795e98c3abb7.tar.gz | |
[Bug #550364] Add get_python_version()
| -rw-r--r-- | sysconfig.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sysconfig.py b/sysconfig.py index 3d369b00..b12b98de 100644 --- a/sysconfig.py +++ b/sysconfig.py @@ -35,6 +35,14 @@ python_build = os.path.isfile(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): """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": libpython = os.path.join(prefix, - "lib", "python" + sys.version[:3]) + "lib", "python" + get_python_version()) if standard_lib: return libpython else: |
