From 04962e90013d7cf58ed9c570d64c8f36b3f6a8ff Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 30 Sep 2014 14:02:24 +0000 Subject: [PATCH] * Removed embedded copy of six using a patch from Chuck Short. Thanks to James Page for letting me know. --- debian/changelog | 7 ++++++ debian/control | 5 ++-- debian/patches/series | 1 + debian/patches/six.patch | 51 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 debian/patches/series create mode 100644 debian/patches/six.patch diff --git a/debian/changelog b/debian/changelog index 3327108..1d880d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-retrying (1.2.3-2) unstable; urgency=medium + + * Removed embedded copy of six using a patch from Chuck Short. Thanks to + James Page for letting me know. + + -- Thomas Goirand Tue, 30 Sep 2014 14:00:40 +0000 + python-retrying (1.2.3-1) unstable; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index a9006d2..491bebe 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ Build-Depends: debhelper (>= 9), python-setuptools, python3-all, python3-setuptools +Build-Depends-Indep: python-six, python3-six Standards-Version: 3.9.5 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-retrying.git Vcs-Git: git://anonscm.debian.org/openstack/python-retrying.git @@ -19,7 +20,7 @@ Homepage: https://github.com/rholder/retrying Package: python-retrying Architecture: all Pre-Depends: dpkg (>= 1.15.6~) -Depends: ${misc:Depends}, ${python:Depends} +Depends: python-six, ${misc:Depends}, ${python:Depends} Description: simplifies the task of adding retry behavior - Python 2.x Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about @@ -37,7 +38,7 @@ Description: simplifies the task of adding retry behavior - Python 2.x Package: python3-retrying Architecture: all Pre-Depends: dpkg (>= 1.15.6~) -Depends: ${misc:Depends}, ${python3:Depends} +Depends: python3-six, ${misc:Depends}, ${python3:Depends} Description: simplifies the task of adding retry behavior - Python 3.x Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..6a5c3e8 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +six.patch diff --git a/debian/patches/six.patch b/debian/patches/six.patch new file mode 100644 index 0000000..ff01cfd --- /dev/null +++ b/debian/patches/six.patch @@ -0,0 +1,51 @@ +Description: Remove six copying and use six directly. +Author: Chuck Short +Forwarded: Not yet +Last-Update: 2014-09-30 + +Index: python-retrying/retrying.py +=================================================================== +--- python-retrying.orig/retrying.py ++++ python-retrying/retrying.py +@@ -40,31 +40,7 @@ import sys + import time + import traceback + +-# Python 3 compatibility hacks, pilfered from https://pypi.python.org/pypi/six/1.6.1 +-PY3 = sys.version_info[0] == 3 +-if PY3: +- def reraise(tp, value, tb=None): +- if value.__traceback__ is not tb: +- raise value.with_traceback(tb) +- raise value +- +-else: +- def exec_(_code_, _globs_=None, _locs_=None): +- """Execute code in a namespace.""" +- if _globs_ is None: +- frame = sys._getframe(1) +- _globs_ = frame.f_globals +- if _locs_ is None: +- _locs_ = frame.f_locals +- del frame +- elif _locs_ is None: +- _locs_ = _globs_ +- exec("""exec _code_ in _globs_, _locs_""") +- +- +- exec_("""def reraise(tp, value, tb=None): +- raise tp, value, tb +-""") ++import six + + # sys.maxint / 2, since Python 3.2 doesn't have a sys.maxint... + MAX_WAIT = 1073741823 +@@ -282,7 +258,7 @@ class Attempt(object): + if wrap_exception: + raise RetryError(self) + else: +- reraise(self.value[0], self.value[1], self.value[2]) ++ six.reraise(self.value[0], self.value[1], self.value[2]) + else: + return self.value +