Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
python-sure: fix for Python 3.10
Browse files Browse the repository at this point in the history
See: gabrielfalcao/sure#169

git-svn-id: file:///srv/repos/svn-community/svn@1065520 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
yan12125 authored and svntogit committed Dec 7, 2021
1 parent 517f4a8 commit 055baa8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
12 changes: 9 additions & 3 deletions trunk/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@

pkgname=python-sure
pkgver=2.0.0
pkgrel=2
pkgrel=3
pkgdesc="An idiomatic testing library for python with powerful and flexible assertions"
arch=('any')
url="https://github.com/gabrielfalcao/sure"
license=('GPL')
depends=('python-six' 'python-mock')
makedepends=('python-setuptools' 'git')
checkdepends=('python-nose' 'python-rednose')
source=("$pkgname-$pkgver.tar.gz::https://github.com/gabrielfalcao/sure/archive/$pkgver.tar.gz")
sha512sums=('d113b08afd63c379ec9f05169b1ad15f3bb616a1f6ad7d0ef6513e98ba7ebb7462254b2d25307906d9f63603fed4f9e4b83ccbca0ec53a2b483f9395fa0fb94a')
source=("$pkgname-$pkgver.tar.gz::https://github.com/gabrielfalcao/sure/archive/$pkgver.tar.gz"
"python310.diff")
sha512sums=('d113b08afd63c379ec9f05169b1ad15f3bb616a1f6ad7d0ef6513e98ba7ebb7462254b2d25307906d9f63603fed4f9e4b83ccbca0ec53a2b483f9395fa0fb94a'
'0703cc88d01928e25e94e92fc0cfee68c6759322c9ee1d1603f381b6d67d6cf9db97f26aad1ccf7f6d6702370bc2c0194245aa3ba1c1b1384027a5712e469139')

prepare() {
export LC_CTYPE=en_US.UTF-8

cd "$srcdir"/sure-$pkgver
# https://github.com/gabrielfalcao/sure/issues/169
patch -Np1 -i ../python310.diff
}

build() {
Expand Down
13 changes: 13 additions & 0 deletions trunk/python310.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sure/__init__.py b/sure/__init__.py
index ef50bd4..d4c2afb 100644
--- a/sure/__init__.py
+++ b/sure/__init__.py
@@ -126,7 +126,7 @@ class CallBack(object):
err = traceback.format_exc().splitlines()[-1]
err = err.replace("{0}:".format(exc_klass.__name__), "").strip()

- if err.startswith(self.callback_name) and (
+ if self.callback_name in err and (
"takes no arguments (1 given)" in err
or "takes 0 positional arguments but 1 was given" in err
):

0 comments on commit 055baa8

Please sign in to comment.