guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: python-chai: Remove Python2 code.


From: guix-commits
Subject: 02/02: gnu: python-chai: Remove Python2 code.
Date: Sat, 28 Aug 2021 17:43:33 -0400 (EDT)

glv pushed a commit to branch core-updates-frozen
in repository guix.

commit d011429b426397d1255dcbb30240467ef7d88f33
Author: Guillaume Le Vaillant <glv@posteo.net>
AuthorDate: Sat Aug 28 23:33:08 2021 +0200

    gnu: python-chai: Remove Python2 code.
    
    * gnu/packages/patches/python-chai-drop-python2.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/python-xyz.scm (python-chai)[source]: Use it.
---
 gnu/local.mk                                       |  1 +
 .../patches/python-chai-drop-python2.patch         | 32 ++++++++++++++++++++++
 gnu/packages/python-xyz.scm                        |  3 +-
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index ad2e4db..f53645a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1534,6 +1534,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
   %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch           \
   %D%/packages/patches/pthreadpool-system-libraries.patch      \
+  %D%/packages/patches/python-chai-drop-python2.patch          \
   %D%/packages/patches/sdcc-disable-non-free-code.patch                \
   %D%/packages/patches/sdl-pango-api_additions.patch           \
   %D%/packages/patches/sdl-pango-blit_overflow.patch           \
diff --git a/gnu/packages/patches/python-chai-drop-python2.patch 
b/gnu/packages/patches/python-chai-drop-python2.patch
new file mode 100644
index 0000000..0eb980e
--- /dev/null
+++ b/gnu/packages/patches/python-chai-drop-python2.patch
@@ -0,0 +1,32 @@
+Patch copied from Gentoo removing obsolete Python2 code.
+
+--- a/chai/chai.py
++++ b/chai/chai.py
+@@ -62,11 +62,6 @@
+             try:
+                 func(self, *args, **kwargs)
+             except UnexpectedCall as e:
+-                # if this is not python3, use python2 syntax
+-                if not hasattr(e, '__traceback__'):
+-                    from .python2 import reraise
+-                    reraise(
+-                        AssertionError, '\n\n' + str(e), sys.exc_info()[-1])
+                 exc = AssertionError('\n\n' + str(e))
+                 setattr(exc, '__traceback__', sys.exc_info()[-1])
+                 raise exc
+--- a/chai/python2.py
++++ b/chai/python2.py
+@@ -1,3 +0,0 @@
+-
+-def reraise(exc, msg, traceback):
+-    raise exc, msg, traceback
+--- a/chai.egg-info/SOURCES.txt
++++ b/chai.egg-info/SOURCES.txt
+@@ -10,7 +10,6 @@
+ chai/exception.py
+ chai/expectation.py
+ chai/mock.py
+-chai/python2.py
+ chai/spy.py
+ chai/stub.py
+ chai.egg-info/PKG-INFO
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 40df068..7782e2c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14561,7 +14561,8 @@ etc.")
               (uri (pypi-uri "chai" version))
               (sha256
                (base32
-                "1k6n6zbgrrs83crp6mr3yqj9zlv40b8rpisyrliwsq7naml2p3gz"))))
+                "1k6n6zbgrrs83crp6mr3yqj9zlv40b8rpisyrliwsq7naml2p3gz"))
+              (patches (search-patches "python-chai-drop-python2.patch"))))
     (build-system python-build-system)
     (home-page "https://github.com/agoragames/chai";)
     (synopsis "Mocking framework for Python")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]