[Python-checkins] r84919 - in python/branches/py3k/Lib: distutils/sysconfig.py logging/__init__.py sysconfig.py

vinay.sajip python-checkins at python.org
Mon Sep 20 12:13:13 CEST 2010


Author: vinay.sajip
Date: Mon Sep 20 12:13:13 2010
New Revision: 84919

Log:
logging: added hasHandlers() to LoggerAdapter.

Modified:
   python/branches/py3k/Lib/distutils/sysconfig.py
   python/branches/py3k/Lib/logging/__init__.py
   python/branches/py3k/Lib/sysconfig.py

Modified: python/branches/py3k/Lib/distutils/sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/distutils/sysconfig.py	(original)
+++ python/branches/py3k/Lib/distutils/sysconfig.py	Mon Sep 20 12:13:13 2010
@@ -56,6 +56,18 @@
     """
     return sys.version[:3]
 
+def _get_build_dir(name, plat_specific):
+    # Assume the executable is in the build directory.  The
+    # pyconfig.h file should be in the same directory.  Since
+    # the build directory may not be the source directory, we
+    # must use "srcdir" from the makefile to find the "Include"
+    # directory.
+    base = os.path.dirname(os.path.abspath(sys.executable))
+    if plat_specific:
+        return base
+    else:
+        thedir = os.path.join(get_config_var('srcdir'), name)
+        return os.path.normpath(thedir)
 
 def get_python_inc(plat_specific=0, prefix=None):
     """Return the directory containing installed Python header files.
@@ -72,17 +84,7 @@
         prefix = plat_specific and EXEC_PREFIX or PREFIX
     if os.name == "posix":
         if python_build:
-            # Assume the executable is in the build directory.  The
-            # pyconfig.h file should be in the same directory.  Since
-            # the build directory may not be the source directory, we
-            # must use "srcdir" from the makefile to find the "Include"
-            # directory.
-            base = os.path.dirname(os.path.abspath(sys.executable))
-            if plat_specific:
-                return base
-            else:
-                incdir = os.path.join(get_config_var('srcdir'), 'Include')
-                return os.path.normpath(incdir)
+            return _get_build_dir('Include', plat_specific)
         return os.path.join(prefix, "include", "python" + get_python_version())
     elif os.name == "nt":
         return os.path.join(prefix, "include")
@@ -117,6 +119,8 @@
         prefix = plat_specific and EXEC_PREFIX or PREFIX
 
     if os.name == "posix":
+        if python_build:
+            return _get_build_dir('Lib', plat_specific)
         libpython = os.path.join(prefix,
                                  "lib", "python" + get_python_version())
         if standard_lib:

Modified: python/branches/py3k/Lib/logging/__init__.py
==============================================================================
--- python/branches/py3k/Lib/logging/__init__.py	(original)
+++ python/branches/py3k/Lib/logging/__init__.py	Mon Sep 20 12:13:13 2010
@@ -1439,6 +1439,12 @@
         """
         return self.logger.isEnabledFor(level)
 
+    def hasHandlers(self):
+        """
+        See if the underlying logger has any handlers.
+        """
+        return self.logger.hasHandlers()
+
 root = RootLogger(WARNING)
 Logger.root = root
 Logger.manager = Manager(Logger.root)

Modified: python/branches/py3k/Lib/sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/sysconfig.py	(original)
+++ python/branches/py3k/Lib/sysconfig.py	Mon Sep 20 12:13:13 2010
@@ -123,8 +123,9 @@
 
 if _PYTHON_BUILD:
     for scheme in ('posix_prefix', 'posix_home'):
-        _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
+        _INSTALL_SCHEMES[scheme]['include'] = '{projectbase}/Include'
         _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'
+        _INSTALL_SCHEMES[scheme]['stdlib'] = '{projectbase}/Lib'
 
 def _subst_vars(s, local_vars):
     try:


More information about the Python-checkins mailing list