[Python-modules-commits] r19394 - in packages/sphinx/trunk/debian (3 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Sun Nov 20 21:36:03 UTC 2011


    Date: Sunday, November 20, 2011 @ 21:35:52
  Author: jwilk
Revision: 19394

Add sphinxcontrib_namespace.diff: create namespace package ?\226?\128?\152sphinxcontrib?\226?\128?\153.
This allows python-sphinxcontrib.* packages, both those using dh_python2 and those using python-support, to be co-importable.

Added:
  packages/sphinx/trunk/debian/patches/sphinxcontrib_namespace.diff
Modified:
  packages/sphinx/trunk/debian/changelog
  packages/sphinx/trunk/debian/patches/series

Modified: packages/sphinx/trunk/debian/changelog
===================================================================
--- packages/sphinx/trunk/debian/changelog	2011-11-20 19:26:48 UTC (rev 19393)
+++ packages/sphinx/trunk/debian/changelog	2011-11-20 21:35:52 UTC (rev 19394)
@@ -19,8 +19,11 @@
     upstream, and makes running tests easier.
   * Use XS-Python-Version instead of debian/pyversions.
   * Fix patch header description, so that they follow DEP-3.
+  * Add sphinxcontrib_namespace.diff: create namespace package
+    ‘sphinxcontrib’. This allows python-sphinxcontrib.* packages, both those
+    using dh_python2 and those using python-support, to be co-importable.
 
- -- Jakub Wilk <jwilk at debian.org>  Sat, 15 Oct 2011 23:27:43 +0200
+ -- Jakub Wilk <jwilk at debian.org>  Sun, 20 Nov 2011 22:32:59 +0100
 
 sphinx (1.0.8+dfsg-2) unstable; urgency=low
 

Modified: packages/sphinx/trunk/debian/patches/series
===================================================================
--- packages/sphinx/trunk/debian/patches/series	2011-11-20 19:26:48 UTC (rev 19393)
+++ packages/sphinx/trunk/debian/patches/series	2011-11-20 21:35:52 UTC (rev 19394)
@@ -4,3 +4,4 @@
 unversioned_grammar_pickle.diff
 show_more_stack_frames.diff
 docstring_parse.diff
+sphinxcontrib_namespace.diff

Added: packages/sphinx/trunk/debian/patches/sphinxcontrib_namespace.diff
===================================================================
--- packages/sphinx/trunk/debian/patches/sphinxcontrib_namespace.diff	                        (rev 0)
+++ packages/sphinx/trunk/debian/patches/sphinxcontrib_namespace.diff	2011-11-20 21:35:52 UTC (rev 19394)
@@ -0,0 +1,30 @@
+Description: Create namespace package ‘sphinxcontrib’.
+ Create namespace package ‘sphinxcontrib’. This allows python-sphinxcontrib.*
+ packages, both those using dh_python2 and those using python-support, to be
+ co-importable.
+Author: Jakub Wilk <jwilk at debian.org>
+Forwarded: not-needed
+Last-Update: 2011-11-20
+
+--- a/sphinx/__init__.py
++++ b/sphinx/__init__.py
+@@ -32,6 +32,19 @@
+     except Exception:
+         pass
+ 
++def _create_sphinext_namespace():
++    # Create namespace package "sphinxcontrib".
++    import pkgutil
++    module_type = type(sys)
++    try:
++        sphinxcontrib = sys.modules['sphinxcontrib']
++    except LookupError:
++        sphinxcontrib = module_type('sphinxcontrib')
++        sphinxcontrib.__path__ = []
++        sys.modules[sphinxcontrib.__name__] = sphinxcontrib
++    sphinxcontrib.__path__ = pkgutil.extend_path(sphinxcontrib.__path__, sphinxcontrib.__name__)
++
++_create_sphinext_namespace()
+ 
+ def main(argv=sys.argv):
+     if sys.version_info[:3] < (2, 4, 0):




More information about the Python-modules-commits mailing list