[Python-modules-commits] [contextlib2] 01/03: Import contextlib2_0.5.4.orig.tar.gz

Tristan Seligmann mithrandi at moszumanska.debian.org
Sun Oct 9 23:06:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

mithrandi pushed a commit to branch master
in repository contextlib2.

commit a8e1ee7bfcb6b60b91c88e4c829f52d17a9ab22d
Author: Tristan Seligmann <mithrandi at debian.org>
Date:   Mon Oct 10 01:04:04 2016 +0200

    Import contextlib2_0.5.4.orig.tar.gz
---
 CONTRIBUTING.md                  |  3 +++
 MANIFEST.in                      |  3 +--
 NEWS.rst                         | 36 +++++++++++++++++++++++++-----------
 PKG-INFO                         | 24 ++++++++++++++----------
 README.rst                       | 20 ++++++++++++--------
 VERSION.txt                      |  2 +-
 contextlib2.egg-info/PKG-INFO    | 24 ++++++++++++++----------
 contextlib2.egg-info/SOURCES.txt |  1 +
 contextlib2.py                   |  3 +++
 docs/index.rst                   |  4 ++--
 setup.cfg                        |  2 +-
 test_contextlib2.py              | 38 ++++++++++++++++++++++++++++++++++++++
 12 files changed, 115 insertions(+), 45 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..ad78220
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+[![Jazzband](https://jazzband.co/static/img/jazzband.svg)](https://jazzband.co/)
+
+This is a [Jazzband](https://jazzband.co/) project. By contributing you agree to abide by the [Contributor Code of Conduct](https://jazzband.co/about/conduct) and follow the [guidelines](https://jazzband.co/about/guidelines).
diff --git a/MANIFEST.in b/MANIFEST.in
index 8d19207..d26c62c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,2 @@
-include *.py *.txt *.rst MANIFEST.in
+include *.py *.txt *.rst *.md MANIFEST.in
 recursive-include docs *.rst *.py make.bat Makefile
-
diff --git a/NEWS.rst b/NEWS.rst
index ec57b0d..d3f68b1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,6 +1,20 @@
 Release History
 ---------------
 
+0.5.4 (2016-07-31)
+^^^^^^^^^^^^^^^^^^
+
+* Thanks to the welcome efforts of Jannis Leidel, contextlib2 is now a
+  [Jazzband](https://jazzband.co/) project! This means that I (Nick Coghlan)
+  am no longer a single point of failure for backports of future contextlib
+  updates to earlier Python versions.
+
+* Issue `#7 <https://github.com/jazzband/contextlib2/issues/7>`__: Backported
+  fix for CPython issue `#27122 <http://bugs.python.org/issue27122>`__,
+  preventing a potential infinite loop on Python 3.5 when handling
+  ``RuntimeError`` (CPython updates by Gregory P. Smith & Serhiy Storchaka)
+
+
 0.5.3 (2016-05-02)
 ^^^^^^^^^^^^^^^^^^
 
@@ -53,8 +67,8 @@ Release History
 0.4.0 (2012-05-05)
 ^^^^^^^^^^^^^^^^^^
 
-* Issue #8: Replace ContextStack with ExitStack (old ContextStack API
-  retained for backwards compatibility)
+* (BitBucket) Issue #8: Replace ContextStack with ExitStack (old ContextStack
+  API retained for backwards compatibility)
 
 * Fall back to unittest2 if unittest is missing required functionality
 
@@ -62,20 +76,20 @@ Release History
 0.3.1 (2012-01-17)
 ^^^^^^^^^^^^^^^^^^
 
-* Issue #7: Add MANIFEST.in so PyPI package contains all relevant files
-  (patch contributed by Doug Latornell)
+* (BitBucket) Issue #7: Add MANIFEST.in so PyPI package contains all relevant
+  files (patch contributed by Doug Latornell)
 
 
 0.3 (2012-01-04)
 ^^^^^^^^^^^^^^^^
 
-* Issue #5: ContextStack.register no longer pointlessly returns the wrapped
-  function
-* Issue #2: Add examples and recipes section to docs
-* Issue #3: ContextStack.register_exit() now accepts objects with __exit__
-  attributes in addition to accepting exit callbacks directly
-* Issue #1: Add ContextStack.preserve() to move all registered callbacks to
-  a new ContextStack object
+* (BitBucket) Issue #5: ContextStack.register no longer pointlessly returns the
+  wrapped function
+* (BitBucket) Issue #2: Add examples and recipes section to docs
+* (BitBucket) Issue #3: ContextStack.register_exit() now accepts objects with
+  __exit__ attributes in addition to accepting exit callbacks directly
+* (BitBucket) Issue #1: Add ContextStack.preserve() to move all registered
+  callbacks to a new ContextStack object
 * Wrapped callbacks now expose __wrapped__ (for direct callbacks) or __self__
   (for context manager methods) attributes to aid in introspection
 * Moved version number to a VERSION.txt file (read by both docs and setup.py)
diff --git a/PKG-INFO b/PKG-INFO
index b8fa6eb..149677e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,23 +1,27 @@
 Metadata-Version: 1.1
 Name: contextlib2
-Version: 0.5.3
+Version: 0.5.4
 Summary: Backports and enhancements for the contextlib module
 Home-page: http://contextlib2.readthedocs.org
 Author: Nick Coghlan
 Author-email: ncoghlan at gmail.com
 License: PSF License
-Description: .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
-            :target: https://contextlib2.readthedocs.org/
-            :alt: Latest Docs
+Description: .. image:: https://jazzband.co/static/img/badge.svg
+           :target: https://jazzband.co/
+           :alt: Jazzband
         
-        .. image:: https://img.shields.io/travis/ncoghlan/contextlib2/master.svg
-           :target: http://travis-ci.org/ncoghlan/contextlib2
+        .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
+           :target: https://contextlib2.readthedocs.org/
+           :alt: Latest Docs
         
-        .. image:: https://coveralls.io/repos/github/ncoghlan/contextlib2/badge.svg?branch=master
-           :target: https://coveralls.io/github/ncoghlan/contextlib2?branch=master
+        .. image:: https://img.shields.io/travis/jazzband/contextlib2/master.svg
+           :target: http://travis-ci.org/jazzband/contextlib2
         
-        .. image:: https://landscape.io/github/ncoghlan/contextlib2/master/landscape.svg
-           :target: https://landscape.io/github/ncoghlan/contextlib2/
+        .. image:: https://coveralls.io/repos/github/jazzband/contextlib2/badge.svg?branch=master
+           :target: https://coveralls.io/github/jazzband/contextlib2?branch=master
+        
+        .. image:: https://landscape.io/github/jazzband/contextlib2/master/landscape.svg
+           :target: https://landscape.io/github/jazzband/contextlib2/
         
         contextlib2 is a backport of the `standard library's contextlib
         module <https://docs.python.org/3.5/library/contextlib.html>`_ to
diff --git a/README.rst b/README.rst
index a8dfd6d..64c4087 100644
--- a/README.rst
+++ b/README.rst
@@ -1,15 +1,19 @@
+.. image:: https://jazzband.co/static/img/badge.svg
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
 .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
-    :target: https://contextlib2.readthedocs.org/
-    :alt: Latest Docs
+   :target: https://contextlib2.readthedocs.org/
+   :alt: Latest Docs
 
-.. image:: https://img.shields.io/travis/ncoghlan/contextlib2/master.svg
-   :target: http://travis-ci.org/ncoghlan/contextlib2
+.. image:: https://img.shields.io/travis/jazzband/contextlib2/master.svg
+   :target: http://travis-ci.org/jazzband/contextlib2
 
-.. image:: https://coveralls.io/repos/github/ncoghlan/contextlib2/badge.svg?branch=master
-   :target: https://coveralls.io/github/ncoghlan/contextlib2?branch=master
+.. image:: https://coveralls.io/repos/github/jazzband/contextlib2/badge.svg?branch=master
+   :target: https://coveralls.io/github/jazzband/contextlib2?branch=master
 
-.. image:: https://landscape.io/github/ncoghlan/contextlib2/master/landscape.svg
-   :target: https://landscape.io/github/ncoghlan/contextlib2/
+.. image:: https://landscape.io/github/jazzband/contextlib2/master/landscape.svg
+   :target: https://landscape.io/github/jazzband/contextlib2/
 
 contextlib2 is a backport of the `standard library's contextlib
 module <https://docs.python.org/3.5/library/contextlib.html>`_ to
diff --git a/VERSION.txt b/VERSION.txt
index be14282..7d85683 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-0.5.3
+0.5.4
diff --git a/contextlib2.egg-info/PKG-INFO b/contextlib2.egg-info/PKG-INFO
index b8fa6eb..149677e 100644
--- a/contextlib2.egg-info/PKG-INFO
+++ b/contextlib2.egg-info/PKG-INFO
@@ -1,23 +1,27 @@
 Metadata-Version: 1.1
 Name: contextlib2
-Version: 0.5.3
+Version: 0.5.4
 Summary: Backports and enhancements for the contextlib module
 Home-page: http://contextlib2.readthedocs.org
 Author: Nick Coghlan
 Author-email: ncoghlan at gmail.com
 License: PSF License
-Description: .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
-            :target: https://contextlib2.readthedocs.org/
-            :alt: Latest Docs
+Description: .. image:: https://jazzband.co/static/img/badge.svg
+           :target: https://jazzband.co/
+           :alt: Jazzband
         
-        .. image:: https://img.shields.io/travis/ncoghlan/contextlib2/master.svg
-           :target: http://travis-ci.org/ncoghlan/contextlib2
+        .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
+           :target: https://contextlib2.readthedocs.org/
+           :alt: Latest Docs
         
-        .. image:: https://coveralls.io/repos/github/ncoghlan/contextlib2/badge.svg?branch=master
-           :target: https://coveralls.io/github/ncoghlan/contextlib2?branch=master
+        .. image:: https://img.shields.io/travis/jazzband/contextlib2/master.svg
+           :target: http://travis-ci.org/jazzband/contextlib2
         
-        .. image:: https://landscape.io/github/ncoghlan/contextlib2/master/landscape.svg
-           :target: https://landscape.io/github/ncoghlan/contextlib2/
+        .. image:: https://coveralls.io/repos/github/jazzband/contextlib2/badge.svg?branch=master
+           :target: https://coveralls.io/github/jazzband/contextlib2?branch=master
+        
+        .. image:: https://landscape.io/github/jazzband/contextlib2/master/landscape.svg
+           :target: https://landscape.io/github/jazzband/contextlib2/
         
         contextlib2 is a backport of the `standard library's contextlib
         module <https://docs.python.org/3.5/library/contextlib.html>`_ to
diff --git a/contextlib2.egg-info/SOURCES.txt b/contextlib2.egg-info/SOURCES.txt
index 090101c..bef1f15 100644
--- a/contextlib2.egg-info/SOURCES.txt
+++ b/contextlib2.egg-info/SOURCES.txt
@@ -1,3 +1,4 @@
+CONTRIBUTING.md
 LICENSE.txt
 MANIFEST.in
 NEWS.rst
diff --git a/contextlib2.py b/contextlib2.py
index a6acf65..f08df14 100644
--- a/contextlib2.py
+++ b/contextlib2.py
@@ -102,6 +102,9 @@ class _GeneratorContextManager(ContextDecorator):
                 # raised inside the "with" statement from being suppressed.
                 return exc is not value
             except RuntimeError as exc:
+                # Don't re-raise the passed in exception
+                if exc is value:
+                    return False
                 # Likewise, avoid suppressing if a StopIteration exception
                 # was passed to throw() and later wrapped into a RuntimeError
                 # (see PEP 479).
diff --git a/docs/index.rst b/docs/index.rst
index 71474a2..72c1e12 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -696,8 +696,8 @@ Development and Support
 contextlib2 is developed and maintained on GitHub_. Problems and suggested
 improvements can be posted to the `issue tracker`_.
 
-.. _GitHub: https://github.com/ncoghlan/contextlib2
-.. _issue tracker: https://github.com/ncoghlan/contextlib2/issues
+.. _GitHub: https://github.com/jazzband/contextlib2
+.. _issue tracker: https://github.com/jazzband/contextlib2/issues
 
 
 .. include:: ../NEWS.rst
diff --git a/setup.cfg b/setup.cfg
index 6f08d0e..6662fa5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
 universal = 1
 
 [egg_info]
-tag_build = 
 tag_date = 0
+tag_build = 
 tag_svn_revision = 0
 
diff --git a/test_contextlib2.py b/test_contextlib2.py
index 3aba52f..e9cd0c7 100755
--- a/test_contextlib2.py
+++ b/test_contextlib2.py
@@ -739,6 +739,44 @@ class TestExitStack(unittest.TestCase):
             pass
 
 
+    def test_dont_reraise_RuntimeError(self):
+        # https://bugs.python.org/issue27122
+        class UniqueException(Exception): pass
+        class UniqueRuntimeError(RuntimeError): pass
+
+        @contextmanager
+        def second():
+            try:
+                yield 1
+            except Exception as exc:
+                # Py2 compatible explicit exception chaining
+                new_exc = UniqueException("new exception")
+                new_exc.__cause__ = exc
+                raise new_exc
+
+        @contextmanager
+        def first():
+            try:
+                yield 1
+            except Exception as exc:
+                raise exc
+
+        # The UniqueRuntimeError should be caught by second()'s exception
+        # handler which chain raised a new UniqueException.
+        with self.assertRaises(UniqueException) as err_ctx:
+            with ExitStack() as es_ctx:
+                es_ctx.enter_context(second())
+                es_ctx.enter_context(first())
+                raise UniqueRuntimeError("please no infinite loop.")
+
+        exc = err_ctx.exception
+        self.assertIsInstance(exc, UniqueException)
+        self.assertIsInstance(exc.__cause__, UniqueRuntimeError)
+        if check_exception_chaining:
+            self.assertIs(exc.__context__, exc.__cause__)
+            self.assertIsNone(exc.__cause__.__context__)
+            self.assertIsNone(exc.__cause__.__cause__)
+
 
 class TestRedirectStream:
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/contextlib2.git



More information about the Python-modules-commits mailing list