[Python-modules-commits] r31554 - in packages/astroid/trunk/debian (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Mon Dec 8 21:34:51 UTC 2014


    Date: Monday, December 8, 2014 @ 21:34:50
  Author: morph
Revision: 31554

* debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch
  - enable fine-grained control over extensions loading; this fix is needed
    after #591676 fix; Addresses: #772018

Added:
  packages/astroid/trunk/debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch
Modified:
  packages/astroid/trunk/debian/changelog
  packages/astroid/trunk/debian/patches/series

Modified: packages/astroid/trunk/debian/changelog
===================================================================
--- packages/astroid/trunk/debian/changelog	2014-12-08 21:32:14 UTC (rev 31553)
+++ packages/astroid/trunk/debian/changelog	2014-12-08 21:34:50 UTC (rev 31554)
@@ -1,3 +1,11 @@
+astroid (1.2.1-3) UNRELEASED; urgency=medium
+
+  * debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch
+    - enable fine-grained control over extensions loading; this fix is needed
+      after #591676 fix; Addresses: #772018
+
+ -- Sandro Tosi <morph at debian.org>  Mon, 08 Dec 2014 21:33:39 +0000
+
 astroid (1.2.1-2) unstable; urgency=medium
 
   * debian/patches/e24cacb15e2e152db155fdca9197a8d1bf9ce235.patch

Added: packages/astroid/trunk/debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch
===================================================================
--- packages/astroid/trunk/debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch	                        (rev 0)
+++ packages/astroid/trunk/debian/patches/afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch	2014-12-08 21:34:50 UTC (rev 31554)
@@ -0,0 +1,44 @@
+# HG changeset patch
+# User Torsten Marek <shlomme at gmail.com>
+# Date 1416661998 -3600
+# Node ID afea46c0380956213976db2ce0f1e8f3cf6a0abc
+# Parent  c9c283ee85618a5e3a0701dac0925804a73ec4b6
+Add support for more fine-grained control over extension loading.
+
+--- a/manager.py
++++ b/manager.py
+@@ -86,6 +86,8 @@ class AstroidManager(OptionsProviderMixI
+             self.astroid_cache = {}
+             self._mod_file_cache = {}
+             self.transforms = {}
++            self.always_load_extensions = False
++            self.extension_package_whitelist = set()
+ 
+     def ast_from_file(self, filepath, modname=None, fallback=True, source=False):
+         """given a module name, return the astroid object"""
+@@ -113,6 +115,16 @@ class AstroidManager(OptionsProviderMixI
+         from astroid.builder import AstroidBuilder
+         return AstroidBuilder(self).string_build('', modname)
+ 
++    def _can_load_extension(self, modname):
++        if self.always_load_extensions:
++            return True
++        if modutils.is_standard_module(modname):
++            return True
++        parts = modname.split('.')
++        return any(
++            '.'.join(parts[:x]) in self.extension_package_whitelist
++            for x in range(1, len(parts) + 1))
++
+     def ast_from_module_name(self, modname, context_file=None):
+         """given a module name, return the astroid object"""
+         if modname in self.astroid_cache:
+@@ -129,7 +141,7 @@ class AstroidManager(OptionsProviderMixI
+                 if module is not None:
+                     return module
+             elif mp_type in (imp.C_BUILTIN, imp.C_EXTENSION):
+-                if mp_type == imp.C_EXTENSION and not modutils.is_standard_module(modname):
++                if mp_type == imp.C_EXTENSION and not self._can_load_extension(modname): 
+                     return self._build_stub_module(modname)
+                 try:
+                     module = modutils.load_module_from_name(modname)

Modified: packages/astroid/trunk/debian/patches/series
===================================================================
--- packages/astroid/trunk/debian/patches/series	2014-12-08 21:32:14 UTC (rev 31553)
+++ packages/astroid/trunk/debian/patches/series	2014-12-08 21:34:50 UTC (rev 31554)
@@ -1 +1,2 @@
 e24cacb15e2e152db155fdca9197a8d1bf9ce235.patch
+afea46c0380956213976db2ce0f1e8f3cf6a0abc.patch




More information about the Python-modules-commits mailing list