1- """Provide access to Python's configuration information. The specific names
2- defined in the module depend heavily on the platform and configuration.
1+ """Provide access to Python's configuration information. The specific
2+ configuration variables available depend heavily on the platform and
3+ configuration. The values may be retrieved using
4+ get_config_var(name), and the list of variables is available via
5+ get_config_vars().keys(). Additional convenience functions are also
6+ available.
37
48Written by: Fred L. Drake, Jr.
59@@ -45,7 +49,7 @@ def get_python_inc(plat_specific=0, prefix=None):
4549 sys.exec_prefix -- i.e., ignore 'plat_specific'.
4650 """
4751 if prefix is None :
48- prefix = ( plat_specific and EXEC_PREFIX or PREFIX )
52+ prefix = plat_specific and EXEC_PREFIX or PREFIX
4953 if os .name == "posix" :
5054 if python_build :
5155 return "Include/"
@@ -55,9 +59,9 @@ def get_python_inc(plat_specific=0, prefix=None):
5559 elif os .name == "mac" :
5660 return os .path .join (prefix , "Include" )
5761 else :
58- raise DistutilsPlatformError , \
59- ( "I don't know where Python installs its C header files " +
60- "on platform '%s'" ) % os .name
62+ raise DistutilsPlatformError (
63+ "I don't know where Python installs its C header files "
64+ "on platform '%s'" % os .name )
6165
6266
6367def get_python_lib (plat_specific = 0 , standard_lib = 0 , prefix = None ):
@@ -75,7 +79,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
7579 sys.exec_prefix -- i.e., ignore 'plat_specific'.
7680 """
7781 if prefix is None :
78- prefix = ( plat_specific and EXEC_PREFIX or PREFIX )
82+ prefix = plat_specific and EXEC_PREFIX or PREFIX
7983
8084 if os .name == "posix" :
8185 libpython = os .path .join (prefix ,
@@ -96,23 +100,23 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
96100 if standard_lib :
97101 return os .path .join (EXEC_PREFIX , "Mac" , "Plugins" )
98102 else :
99- raise DistutilsPlatformError , \
100- "OK, where DO site-specific extensions go on the Mac?"
103+ raise DistutilsPlatformError (
104+ "OK, where DO site-specific extensions go on the Mac?" )
101105 else :
102106 if standard_lib :
103107 return os .path .join (PREFIX , "Lib" )
104108 else :
105- raise DistutilsPlatformError , \
106- "OK, where DO site-specific modules go on the Mac?"
109+ raise DistutilsPlatformError (
110+ "OK, where DO site-specific modules go on the Mac?" )
107111 else :
108- raise DistutilsPlatformError , \
109- ( "I don't know where Python installs its library " +
110- "on platform '%s'" ) % os .name
112+ raise DistutilsPlatformError (
113+ "I don't know where Python installs its library "
114+ "on platform '%s'" % os .name )
111115
112116# get_python_lib()
113117
114118
115- def customize_compiler (compiler ):
119+ def customize_compiler (compiler ):
116120 """Do any platform-specific customization of the CCompiler instance
117121 'compiler'. Mainly needed on Unix, so we can plug in the information
118122 that varies across Unices and is stored in Python's Makefile.
@@ -299,7 +303,7 @@ def _init_posix():
299303 if hasattr (msg , "strerror" ):
300304 my_msg = my_msg + " (%s)" % msg .strerror
301305
302- raise DistutilsPlatformError , my_msg
306+ raise DistutilsPlatformError ( my_msg )
303307
304308
305309 # On AIX, there are wrong paths to the linker scripts in the Makefile
0 commit comments