[Python-modules-commits] r24027 - in packages/python-stdnum/trunk/debian (4 files)
adejong at users.alioth.debian.org
adejong at users.alioth.debian.org
Sat Apr 27 12:53:12 UTC 2013
Date: Saturday, April 27, 2013 @ 12:53:09
Author: adejong
Revision: 24027
* Fix build failures on Python 3.3 (closes: #705809):
- Add dont-depend-on-dict-ordering.patch which fixes the doctests to
not be dependent on dict ordering
- Add use-cleaner-way-to-get-all-modules.patch which uses a cleaner
way to list all stdnum modules
Added:
packages/python-stdnum/trunk/debian/patches/dont-depend-on-dict-ordering.patch
packages/python-stdnum/trunk/debian/patches/use-cleaner-way-to-get-all-modules.patch
Modified:
packages/python-stdnum/trunk/debian/changelog
packages/python-stdnum/trunk/debian/patches/series
Modified: packages/python-stdnum/trunk/debian/changelog
===================================================================
--- packages/python-stdnum/trunk/debian/changelog 2013-04-27 05:33:31 UTC (rev 24026)
+++ packages/python-stdnum/trunk/debian/changelog 2013-04-27 12:53:09 UTC (rev 24027)
@@ -5,8 +5,13 @@
* Remove coverage and build data on clean (closes: #671426)
* Update Vcs-* fields to point to anonscm
* Upgrade to standards-version 3.9.4 (no changes needed)
+ * Fix build failures on Python 3.3 (closes: #705809):
+ - Add dont-depend-on-dict-ordering.patch which fixes the doctests to
+ not be dependent on dict ordering
+ - Add use-cleaner-way-to-get-all-modules.patch which uses a cleaner
+ way to list all stdnum modules
- -- Arthur de Jong <adejong at debian.org> Fri, 26 Apr 2013 23:55:30 +0200
+ -- Arthur de Jong <adejong at debian.org> Sat, 27 Apr 2013 14:47:40 +0200
python-stdnum (0.7-1) unstable; urgency=low
Added: packages/python-stdnum/trunk/debian/patches/dont-depend-on-dict-ordering.patch
===================================================================
--- packages/python-stdnum/trunk/debian/patches/dont-depend-on-dict-ordering.patch (rev 0)
+++ packages/python-stdnum/trunk/debian/patches/dont-depend-on-dict-ordering.patch 2013-04-27 12:53:09 UTC (rev 24027)
@@ -0,0 +1,67 @@
+Description: Fix doctest to not be dependent on dict ordering
+Origin: upstream, http://arthurdejong.org/git/python-stdnum/commit/?id=30c832f
+
+--- a/stdnum/numdb.py
++++ b/stdnum/numdb.py
+@@ -39,20 +39,47 @@ To split a number:
+
+ To split the number and get properties for each part:
+
+->>> dbfile.info('01006')
+-[('0', {'prop1': 'foo'}), ('100', {'prop2': 'bar'}), ('6', {})]
+->>> dbfile.info('02006')
+-[('0', {'prop1': 'foo'}), ('200', {'prop2': 'bar', 'prop3': 'baz'}), ('6', {})]
+->>> dbfile.info('03456')
+-[('0', {'prop1': 'foo'}), ('345', {'prop2': 'bar', 'prop3': 'baz'}), ('6', {})]
+->>> dbfile.info('902006')
+-[('90', {'prop1': 'booz'}), ('20', {'prop2': 'foo'}), ('06', {})]
+->>> dbfile.info('909856')
+-[('90', {'prop1': 'booz'}), ('985', {'prop2': 'fooz'}), ('6', {})]
+->>> dbfile.info('9889')
+-[('98', {'prop1': 'booz'}), ('89', {'prop2': 'foo'})]
+->>> dbfile.info('633322')
+-[('6', {'prop1': 'boo'}), ('333', {'prop2': 'bar', 'prop3': 'baz'}), ('22', {})]
++>>> dbfile.info('01006') == [
++... ('0', {'prop1': 'foo'}),
++... ('100', {'prop2': 'bar'}),
++... ('6', {}),
++... ]
++True
++>>> dbfile.info('02006') == [
++... ('0', {'prop1': 'foo'}),
++... ('200', {'prop2': 'bar', 'prop3': 'baz'}),
++... ('6', {}),
++... ]
++True
++>>> dbfile.info('03456') == [
++... ('0', {'prop1': 'foo'}),
++... ('345', {'prop2': 'bar', 'prop3': 'baz'}),
++... ('6', {}),
++... ]
++True
++>>> dbfile.info('902006') == [
++... ('90', {'prop1': 'booz'}),
++... ('20', {'prop2': 'foo'}),
++... ('06', {}),
++... ]
++True
++>>> dbfile.info('909856') == [
++... ('90', {'prop1': 'booz'}),
++... ('985', {'prop2': 'fooz'}),
++... ('6', {}),
++... ]
++True
++>>> dbfile.info('9889') == [
++... ('98', {'prop1': 'booz'}),
++... ('89', {'prop2': 'foo'}),
++... ]
++True
++>>> dbfile.info('633322') == [
++... ('6', {'prop1': 'boo'}),
++... ('333', {'prop2': 'bar', 'prop3': 'baz'}),
++... ('22', {}),
++... ]
++True
+
+ """
+
Modified: packages/python-stdnum/trunk/debian/patches/series
===================================================================
--- packages/python-stdnum/trunk/debian/patches/series 2013-04-27 05:33:31 UTC (rev 24026)
+++ packages/python-stdnum/trunk/debian/patches/series 2013-04-27 12:53:09 UTC (rev 24027)
@@ -1 +1,3 @@
support-python3.patch
+dont-depend-on-dict-ordering.patch
+use-cleaner-way-to-get-all-modules.patch
Added: packages/python-stdnum/trunk/debian/patches/use-cleaner-way-to-get-all-modules.patch
===================================================================
--- packages/python-stdnum/trunk/debian/patches/use-cleaner-way-to-get-all-modules.patch (rev 0)
+++ packages/python-stdnum/trunk/debian/patches/use-cleaner-way-to-get-all-modules.patch 2013-04-27 12:53:09 UTC (rev 24027)
@@ -0,0 +1,30 @@
+Description: Use a cleaner way to get all stdnum modules
+ This mechanism should work from Python 2.6 up to and including Python 3.3.
+Origin: upstream, http://arthurdejong.org/git/python-stdnum/commit/?id=2d956eb
+
+--- a/stdnum/util.py
++++ b/stdnum/util.py
+@@ -25,6 +25,7 @@ stdnum.
+ """
+
+ import pkgutil
++import sys
+
+
+ def clean(number, deletechars):
+@@ -38,11 +39,13 @@ def clean(number, deletechars):
+
+ def get_number_modules(base='stdnum'):
+ """Yield all the module and package names under the specified module."""
+- module = __import__(base, globals(), locals(), [base])
++ __import__(base)
++ module = sys.modules[base]
+ for loader, name, is_pkg in pkgutil.walk_packages(
+ module.__path__, module.__name__ + '.',
+ onerror=lambda x: None
+ ):
+- module = __import__(name, globals(), locals(), [name])
++ __import__(name)
++ module = sys.modules[name]
+ if hasattr(module, 'is_valid'):
+ yield module
More information about the Python-modules-commits
mailing list