[arch-commits] Commit in python-vcrpy/trunk (PKGBUILD python3.7.patch)

Felix Yan felixonmars at archlinux.org
Sat Jul 21 09:08:03 UTC 2018


    Date: Saturday, July 21, 2018 @ 09:08:01
  Author: felixonmars
Revision: 362688

upgpkg: python-vcrpy 1.13.0-1

Added:
  python-vcrpy/trunk/python3.7.patch
Modified:
  python-vcrpy/trunk/PKGBUILD

-----------------+
 PKGBUILD        |    9 ++++++---
 python3.7.patch |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-07-21 08:06:18 UTC (rev 362687)
+++ PKGBUILD	2018-07-21 09:08:01 UTC (rev 362688)
@@ -3,7 +3,7 @@
 
 pkgbase=python-vcrpy
 pkgname=('python-vcrpy' 'python2-vcrpy')
-pkgver=1.12.0
+pkgver=1.13.0
 pkgrel=1
 pkgdesc='Automatically mock your HTTP interactions to simplify and speed up testing'
 arch=('any')
@@ -14,10 +14,13 @@
              'python2-mock')
 checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-pytest-httpbin'
               'python2-pytest-httpbin' 'python-mock')
-source=("$pkgbase-$pkgver.tar.gz::https://github.com/kevin1024/vcrpy/archive/v$pkgver.tar.gz")
-sha512sums=('c47d50cd399fa11eb6fd1d210b056ef9768e501799a9774f7338370177754e35b9a9ee43ff5cb7f1f43073624f9011cc1ca230dbdf317c1bccd0ec6b506c61e0')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/kevin1024/vcrpy/archive/v$pkgver.tar.gz"
+        python3.7.patch)
+sha512sums=('dda875faa6c5e29c26c774b45b27e046437cf9add0b7e73bd5be545062dbde46b91e90fbc0dafe1efd5c76e447068fabd3018c6ff35db1e8bb009e50a72bd341'
+            '369676b91ec3f0118112391d6b30bf4787211ec8fe9e35b79eb32b8179b02f70495c6b7d58e4d756c8530038a3fc7fc288cc636cd4a78193ecc8798b28d238dc')
 
 prepare() {
+  patch -d vcrpy-$pkgver -p1 -i "$srcdir"/python3.7.patch
   cp -a vcrpy-$pkgver{,-py2}
 }
 

Added: python3.7.patch
===================================================================
--- python3.7.patch	                        (rev 0)
+++ python3.7.patch	2018-07-21 09:08:01 UTC (rev 362688)
@@ -0,0 +1,39 @@
+diff --git a/tests/integration/test_urllib2.py b/tests/integration/test_urllib2.py
+index 8a633ba..3c0b021 100644
+--- a/tests/integration/test_urllib2.py
++++ b/tests/integration/test_urllib2.py
+@@ -1,6 +1,7 @@
+ # -*- coding: utf-8 -*-
+ '''Integration tests with urllib2'''
+ 
++import ssl
+ from six.moves.urllib.request import urlopen
+ from six.moves.urllib_parse import urlencode
+ import pytest_httpbin.certs
+@@ -12,7 +13,9 @@ from assertions import assert_cassette_has_one_response
+ 
+ 
+ def urlopen_with_cafile(*args, **kwargs):
+-    kwargs['cafile'] = pytest_httpbin.certs.where()
++    context = ssl.create_default_context(cafile=pytest_httpbin.certs.where())
++    context.check_hostname = False
++    kwargs['context'] = context
+     try:
+         return urlopen(*args, **kwargs)
+     except TypeError:
+diff --git a/vcr/cassette.py b/vcr/cassette.py
+index d64dec6..3b6f54e 100644
+--- a/vcr/cassette.py
++++ b/vcr/cassette.py
+@@ -136,7 +136,10 @@ class CassetteContextDecorator(object):
+                 except Exception:
+                     to_yield = coroutine.throw(*sys.exc_info())
+                 else:
+-                    to_yield = coroutine.send(to_send)
++                    try:
++                        to_yield = coroutine.send(to_send)
++                    except StopIteration:
++                        break
+ 
+     def _handle_function(self, fn):
+         with self as cassette:



More information about the arch-commits mailing list