[Python-modules-commits] r24754 - in packages/bunch/trunk/debian (5 files)
laarmen-guest at users.alioth.debian.org
laarmen-guest at users.alioth.debian.org
Wed Jun 12 07:47:57 UTC 2013
Date: Wednesday, June 12, 2013 @ 07:47:55
Author: laarmen-guest
Revision: 24754
Remove SOURCES.txt from the binary package
Add a patch to fix unconditional except: blocks
Added:
packages/bunch/trunk/debian/patches/
packages/bunch/trunk/debian/patches/fix-except
packages/bunch/trunk/debian/patches/series
Modified:
packages/bunch/trunk/debian/changelog
packages/bunch/trunk/debian/rules
Modified: packages/bunch/trunk/debian/changelog
===================================================================
--- packages/bunch/trunk/debian/changelog 2013-06-12 07:41:07 UTC (rev 24753)
+++ packages/bunch/trunk/debian/changelog 2013-06-12 07:47:55 UTC (rev 24754)
@@ -1,5 +1,6 @@
bunch (1.0.1-1) UNRELEASED; urgency=low
* Initial release. (Closes: #705950)
+ * Patch out some untyped except statements in the source.
-- Simon Chopin <chopin.simon at gmail.com> Tue, 23 Apr 2013 17:40:50 +0200
Added: packages/bunch/trunk/debian/patches/fix-except
===================================================================
--- packages/bunch/trunk/debian/patches/fix-except (rev 0)
+++ packages/bunch/trunk/debian/patches/fix-except 2013-06-12 07:47:55 UTC (rev 24754)
@@ -0,0 +1,34 @@
+From: Simon Chopin <chopin.simon at gmail.com>
+Date: Wed, 12 Jun 2013 09:16:27 +0200
+Subject: Fix unspecified except: blocks
+ Those are bad since they catch every exception out there, including
+ KeyboardInterrupt and the like.
+ .
+ The first block is entirely removed as the two function call are not
+ supposed to raise anything given legit parameters.
+ The second should, according to the method description, only catch
+ KeyError to change them into AttributeError.
+Forwarded: https://github.com/dsc/bunch/pull/9
+--- a/bunch/__init__.py
++++ b/bunch/__init__.py
+@@ -82,10 +82,7 @@
+ >>> 'hello' in b
+ True
+ """
+- try:
+- return hasattr(self, k) or dict.__contains__(self, k)
+- except:
+- return False
++ return hasattr(self, k) or dict.__contains__(self, k)
+
+ # only called if k not found in normal places
+ def __getattr__(self, k):
+@@ -142,7 +139,7 @@
+ except AttributeError:
+ try:
+ self[k] = v
+- except:
++ except KeyError:
+ raise AttributeError(k)
+ else:
+ object.__setattr__(self, k, v)
Added: packages/bunch/trunk/debian/patches/series
===================================================================
--- packages/bunch/trunk/debian/patches/series (rev 0)
+++ packages/bunch/trunk/debian/patches/series 2013-06-12 07:47:55 UTC (rev 24754)
@@ -0,0 +1 @@
+fix-except
Modified: packages/bunch/trunk/debian/rules
===================================================================
--- packages/bunch/trunk/debian/rules 2013-06-12 07:41:07 UTC (rev 24753)
+++ packages/bunch/trunk/debian/rules 2013-06-12 07:47:55 UTC (rev 24754)
@@ -10,3 +10,7 @@
$$py -m bunch.test -v; \
done
endif
+
+override_dh_auto_install:
+ dh_auto_install
+ rm -f debian/python-bunch/usr/lib/python2*/dist-packages/bunch-*.egg-info/SOURCES.txt
More information about the Python-modules-commits
mailing list