Accepting request 578275 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/578275
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=20
This commit is contained in:
Dominique Leuenberger 2018-02-25 10:35:31 +00:00 committed by Git OBS Bridge
commit 1e61e379fa
5 changed files with 34 additions and 56 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ab87dd91c0c4073758d07334c1e5f712ce8fe48f007b86f8238773963ee700a6
size 435142

3
cffi-1.11.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d
size 436857

View File

@ -1,45 +0,0 @@
# HG changeset patch
# User Armin Rigo <arigo@tunes.org>
# Date 1515619092 -3600
# Node ID d16706e3c2da4ff29729c312b96af5cc251f82c4
# Parent a570b34ac8a60becdbc4a3404c737d03b4691353
Issue #352
Oops.
diff --git a/c/lib_obj.c b/c/lib_obj.c
--- a/c/lib_obj.c
+++ b/c/lib_obj.c
@@ -505,6 +505,7 @@
return x;
missing:
+ /*** ATTRIBUTEERROR IS SET HERE ***/
p = PyText_AsUTF8(name);
if (p == NULL)
return NULL;
@@ -534,6 +535,7 @@
#if PY_MAJOR_VERSION >= 3
if (strcmp(p, "__loader__") == 0 || strcmp(p, "__spec__") == 0) {
/* some more module-like behavior hacks */
+ PyErr_Clear();
Py_INCREF(Py_None);
return Py_None;
}
diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py
--- a/testing/cffi1/test_recompiler.py
+++ b/testing/cffi1/test_recompiler.py
@@ -2287,3 +2287,13 @@
def test_char16_char32_plain_c():
test_char16_char32_type(no_cpp=True)
+
+def test_loader_spec():
+ ffi = FFI()
+ lib = verify(ffi, "test_loader_spec", "")
+ if sys.version_info < (3,):
+ assert not hasattr(lib, '__loader__')
+ assert not hasattr(lib, '__spec__')
+ else:
+ assert lib.__loader__ is None
+ assert lib.__spec__ is None

View File

@ -1,3 +1,29 @@
-------------------------------------------------------------------
Tue Feb 20 00:23:55 UTC 2018 - arun@gmx.de
- specfile:
* delete patch cffi-loader.patch; included upstream
- update to version 1.11.4:
* Windows: reverted linking with python3.dll, because virtualenv
does not make this DLL available to virtual environments for
now. See Issue #355. On Windows only, the C extension modules
created by cffi follow for now the standard naming scheme
foo.cp36-win32.pyd, to make it clear that they are regular CPython
modules depending on python36.dll.
- changes from version 1.11.3:
* Fix on CPython 3.x: reading the attributes __loader__ or __spec__
from the cffi-generated lib modules gave a buggy
SystemError. (These attributes are always None, and provided only
to help compatibility with tools that expect them in all modules.)
* More Windows fixes: workaround for MSVC not supporting large
literal strings in C code (from
ffi.embedding_init_code(large_string)); and an issue with
Py_LIMITED_API linking with python35.dll/python36.dll instead of
python3.dll.
* Small documentation improvements.
-------------------------------------------------------------------
Thu Jan 18 13:35:08 UTC 2018 - tchvatal@suse.com

View File

@ -17,17 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define modname cffi
Name: python-%{modname}
Version: 1.11.2
Name: python-cffi
Version: 1.11.4
Release: 0
Summary: Foreign Function Interface for Python calling C code
License: MIT
Group: Development/Languages/Python
Url: http://%{modname}.readthedocs.org
Source0: https://files.pythonhosted.org/packages/source/c/cffi/%{modname}-%{version}.tar.gz
Url: http://cffi.readthedocs.org
Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
Source1: python-cffi-rpmlintrc
Patch0: cffi-loader.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pycparser}
BuildRequires: %{python_module pytest}
@ -44,8 +42,7 @@ Foreign Function Interface for Python calling C code. The aim of this project
is to provide a convenient and reliable way of calling C code from Python.
%prep
%setup -q -n %{modname}-%{version}
%patch0 -p1
%setup -q -n cffi-%{version}
%build
export CFLAGS="%{optflags}"