[Python-checkins] python/dist/src/Lib/distutils sysconfig.py,1.54,1.55

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
Wed, 13 Nov 2002 17:43:02 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv13960

Modified Files:
	sysconfig.py 
Log Message:
[Bug #550364] Add get_python_version()

Index: sysconfig.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** sysconfig.py	13 Nov 2002 17:03:05 -0000	1.54
--- sysconfig.py	14 Nov 2002 01:43:00 -0000	1.55
***************
*** 36,39 ****
--- 36,47 ----
  
  
+ 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.
***************
*** 94,98 ****
      if os.name == "posix":
          libpython = os.path.join(prefix,
!                                  "lib", "python" + sys.version[:3])
          if standard_lib:
              return libpython
--- 102,106 ----
      if os.name == "posix":
          libpython = os.path.join(prefix,
!                                  "lib", "python" + get_python_version())
          if standard_lib:
              return libpython