Author: Matti Picus <[email protected]>
Branch: release-pypy2.7-v7.x
Changeset: r98155:5ec005b3e483
Date: 2019-11-26 06:11 -0800
http://bitbucket.org/pypy/pypy/changeset/5ec005b3e483/
Log: merge default into branch, bump version
diff too long, truncating to 2000 out of 11835 lines
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -50,4 +50,10 @@
de061d87e39c7df4e436974096d7982c676a859d release-pypy3.6-v7.1.0
784b254d669919c872a505b807db8462b6140973 release-pypy3.6-v7.1.1
8cdda8b8cdb8ff29d9e620cccd6c5edd2f2a23ec release-pypy2.7-v7.1.1
-
+85dae4fd5c234b482feff834c73e089872194541 release-pypy2.7-v7.2.0rc0
+7ffb92269488f37c707ce66076f50ffd8613f8e2 release-pypy3.6-v7.2.0rc0
+4d6761df14ffd6f38450f183ac1fad32c946c21b release-pypy3.6-v7.2.0rc1
+5da45ced70e515f94686be0df47c59abd1348ebc release-pypy3.6-v7.2.0rc2
+4a68d8d3d2fc1faec2e83bcb4d28559099092574 release-pypy2.7-v7.2.0rc2
+4a68d8d3d2fc1faec2e83bcb4d28559099092574 release-pypy2.7-v7.2.0
+5da45ced70e515f94686be0df47c59abd1348ebc release-pypy3.6-v7.2.0
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -3,10 +3,11 @@
License
=======
-Except when otherwise stated (look for LICENSE files in directories or
-information at the beginning of each file) all software and documentation in
-the 'rpython', 'pypy', 'ctype_configure', 'dotviewer', 'demo', 'lib_pypy',
-'py', and '_pytest' directories is licensed as follows:
+Except when otherwise stated (look for LICENSE files in directories
+or information at the beginning of each file) all software and
+documentation in the 'rpython', 'pypy', 'ctype_configure', 'dotviewer',
+'demo', 'extra_tests', 'include', 'lib_pypy', 'py', and '_pytest'
+directories is licensed as follows:
The MIT License
diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -9,15 +9,15 @@
The home page for the interpreter is:
- http://pypy.org/
+ https://pypy.org/
If you want to help developing PyPy, this documentation might help you:
- http://doc.pypy.org/
+ https://doc.pypy.org/
More documentation about the RPython framework can be found here:
- http://rpython.readthedocs.io/
+ https://rpython.readthedocs.io/
The source for the documentation is in the pypy/doc directory.
@@ -25,7 +25,7 @@
Using PyPy instead of CPython
-----------------------------
-Please read the information at http://pypy.org/ to find the correct way to
+Please read the information at https://pypy.org/ to find the correct way to
download and use PyPy as an alternative to CPython.
@@ -36,7 +36,7 @@
interpreter. It is time-consuming and requires significant computing resources.
More information can be found here:
- http://doc.pypy.org/en/latest/build.html
+ https://doc.pypy.org/en/latest/build.html
Enjoy and send us feedback!
diff --git a/extra_tests/cffi_tests/cffi0/test_function.py
b/extra_tests/cffi_tests/cffi0/test_function.py
--- a/extra_tests/cffi_tests/cffi0/test_function.py
+++ b/extra_tests/cffi_tests/cffi0/test_function.py
@@ -114,7 +114,7 @@
ffi = FFI(backend=self.Backend())
ffi.cdef("""
int fputs(const char *, void *);
- void *stderr;
+ extern void *stderr;
""")
needs_dlopen_none()
ffi.C = ffi.dlopen(None)
@@ -131,7 +131,7 @@
ffi = FFI(backend=self.Backend())
ffi.cdef("""
int fputs(char *, void *);
- void *stderr;
+ extern void *stderr;
""")
needs_dlopen_none()
ffi.C = ffi.dlopen(None)
@@ -148,7 +148,7 @@
ffi = FFI(backend=self.Backend())
ffi.cdef("""
int fprintf(void *, const char *format, ...);
- void *stderr;
+ extern void *stderr;
""")
needs_dlopen_none()
ffi.C = ffi.dlopen(None)
@@ -210,7 +210,7 @@
py.test.skip("probably no symbol 'stderr' in the lib")
ffi.cdef("""
int fputs(const char *, void *);
- void *stderr;
+ extern void *stderr;
""")
needs_dlopen_none()
ffi.C = ffi.dlopen(None)
@@ -257,7 +257,7 @@
py.test.skip("probably no symbol 'stdout' in the lib")
ffi = FFI(backend=self.Backend())
ffi.cdef("""
- void *stdout;
+ extern void *stdout;
""")
needs_dlopen_none()
C = ffi.dlopen(None)
@@ -497,7 +497,7 @@
ffi.cdef("""
typedef enum { MYE1, MYE2 } myenum_t;
double myfunc(double);
- double myvar;
+ extern double myvar;
const double myconst;
#define MYFOO 42
""")
@@ -508,7 +508,7 @@
if self.Backend is CTypesBackend:
py.test.skip("not with the ctypes backend")
ffi = FFI(backend=self.Backend())
- ffi.cdef("int foobar(void); int foobaz;")
+ ffi.cdef("int foobar(void); extern int foobaz;")
lib = ffi.dlopen(lib_m)
ffi.dlclose(lib)
e = py.test.raises(ValueError, getattr, lib, 'foobar')
diff --git a/extra_tests/cffi_tests/cffi0/test_ownlib.py
b/extra_tests/cffi_tests/cffi0/test_ownlib.py
--- a/extra_tests/cffi_tests/cffi0/test_ownlib.py
+++ b/extra_tests/cffi_tests/cffi0/test_ownlib.py
@@ -202,7 +202,7 @@
py.test.skip("fix the auto-generation of the tiny test lib")
ffi = FFI(backend=self.Backend())
ffi.cdef("""
- int my_array[7];
+ extern int my_array[7];
""")
ownlib = ffi.dlopen(self.module)
for i in range(7):
@@ -224,7 +224,7 @@
py.test.skip("not supported by the ctypes backend")
ffi = FFI(backend=self.Backend())
ffi.cdef("""
- int my_array[];
+ extern int my_array[];
""")
ownlib = ffi.dlopen(self.module)
for i in range(7):
@@ -292,7 +292,7 @@
long bottom;
} RECT;
- long left, top, right, bottom;
+ extern long left, top, right, bottom;
RECT ReturnRect(int i, RECT ar, RECT* br, POINT cp, RECT dr,
RECT *er, POINT fp, RECT gr);
@@ -322,7 +322,7 @@
if self.Backend is CTypesBackend:
py.test.skip("not implemented with the ctypes backend")
ffi = FFI(backend=self.Backend())
- ffi.cdef("long left; int test_getting_errno(void);")
+ ffi.cdef("extern long left; int test_getting_errno(void);")
lib = ffi.dlopen(self.module)
lib.left = 123456
p = ffi.addressof(lib, "left")
diff --git a/extra_tests/cffi_tests/cffi0/test_parsing.py
b/extra_tests/cffi_tests/cffi0/test_parsing.py
--- a/extra_tests/cffi_tests/cffi0/test_parsing.py
+++ b/extra_tests/cffi_tests/cffi0/test_parsing.py
@@ -325,6 +325,7 @@
assert value == sys.maxsize * 2 - 40
def test__is_constant_globalvar():
+ import warnings
for input, expected_output in [
("int a;", False),
("const int a;", True),
@@ -342,10 +343,13 @@
("const int a[5][6];", False),
]:
ffi = FFI()
- ffi.cdef(input)
+ with warnings.catch_warnings(record=True) as log:
+ warnings.simplefilter("always")
+ ffi.cdef(input)
declarations = ffi._parser._declarations
assert ('constant a' in declarations) == expected_output
assert ('variable a' in declarations) == (not expected_output)
+ assert len(log) == (1 - expected_output)
def test_restrict():
from cffi import model
@@ -355,7 +359,7 @@
("int *a;", False),
]:
ffi = FFI()
- ffi.cdef(input)
+ ffi.cdef("extern " + input)
tp, quals = ffi._parser._declarations['variable a']
assert bool(quals & model.Q_RESTRICT) == expected_output
diff --git a/extra_tests/cffi_tests/cffi0/test_verify.py
b/extra_tests/cffi_tests/cffi0/test_verify.py
--- a/extra_tests/cffi_tests/cffi0/test_verify.py
+++ b/extra_tests/cffi_tests/cffi0/test_verify.py
@@ -4,6 +4,7 @@
import sys, os, math, weakref
from cffi import FFI, VerificationError, VerificationMissing, model, FFIError
from extra_tests.cffi_tests.support import *
+from extra_tests.cffi_tests.support import extra_compile_args
lib_m = ['m']
@@ -14,17 +15,6 @@
lib_m = ['msvcrt']
pass # no obvious -Werror equivalent on MSVC
else:
- if (sys.platform == 'darwin' and
- [int(x) for x in os.uname()[2].split('.')] >= [11, 0, 0]):
- # assume a standard clang or gcc
- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
- # special things for clang
- extra_compile_args.append('-Qunused-arguments')
- else:
- # assume a standard gcc
- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion',
- '-Wno-unused-parameter']
-
class FFI(FFI):
def verify(self, *args, **kwds):
return super(FFI, self).verify(
@@ -287,7 +277,7 @@
def test_var_signed_integer_types():
ffi = FFI()
lst = all_signed_integer_types(ffi)
- csource = "\n".join(["%s somevar_%s;" % (tp, tp.replace(' ', '_'))
+ csource = "\n".join(["static %s somevar_%s;" % (tp, tp.replace(' ', '_'))
for tp in lst])
ffi.cdef(csource)
lib = ffi.verify(csource)
@@ -306,7 +296,7 @@
def test_var_unsigned_integer_types():
ffi = FFI()
lst = all_unsigned_integer_types(ffi)
- csource = "\n".join(["%s somevar_%s;" % (tp, tp.replace(' ', '_'))
+ csource = "\n".join(["static %s somevar_%s;" % (tp, tp.replace(' ', '_'))
for tp in lst])
ffi.cdef(csource)
lib = ffi.verify(csource)
@@ -818,8 +808,8 @@
def test_access_variable():
ffi = FFI()
- ffi.cdef("int foo(void);\n"
- "int somenumber;")
+ ffi.cdef("static int foo(void);\n"
+ "static int somenumber;")
lib = ffi.verify("""
static int somenumber = 2;
static int foo(void) {
@@ -836,7 +826,7 @@
def test_access_address_of_variable():
# access the address of 'somenumber': need a trick
ffi = FFI()
- ffi.cdef("int somenumber; static int *const somenumberptr;")
+ ffi.cdef("static int somenumber; static int *const somenumberptr;")
lib = ffi.verify("""
static int somenumber = 2;
#define somenumberptr (&somenumber)
@@ -849,7 +839,7 @@
def test_access_array_variable(length=5):
ffi = FFI()
ffi.cdef("int foo(int);\n"
- "int somenumber[%s];" % (length,))
+ "static int somenumber[%s];" % (length,))
lib = ffi.verify("""
static int somenumber[] = {2, 2, 3, 4, 5};
static int foo(int i) {
@@ -881,7 +871,7 @@
ffi = FFI()
ffi.cdef("struct foo { int x; ...; };\n"
"int foo(int);\n"
- "struct foo stuff;")
+ "static struct foo stuff;")
lib = ffi.verify("""
struct foo { int x, y, z; };
static struct foo stuff = {2, 5, 8};
@@ -905,9 +895,9 @@
def test_access_callback():
ffi = FFI()
- ffi.cdef("int (*cb)(int);\n"
- "int foo(int);\n"
- "void reset_cb(void);")
+ ffi.cdef("static int (*cb)(int);\n"
+ "static int foo(int);\n"
+ "static void reset_cb(void);")
lib = ffi.verify("""
static int g(int x) { return x * 7; }
static int (*cb)(int);
@@ -923,9 +913,9 @@
def test_access_callback_function_typedef():
ffi = FFI()
ffi.cdef("typedef int mycallback_t(int);\n"
- "mycallback_t *cb;\n"
- "int foo(int);\n"
- "void reset_cb(void);")
+ "static mycallback_t *cb;\n"
+ "static int foo(int);\n"
+ "static void reset_cb(void);")
lib = ffi.verify("""
static int g(int x) { return x * 7; }
static int (*cb)(int);
@@ -1075,7 +1065,7 @@
def test_autofilled_struct_as_argument_dynamic():
ffi = FFI()
ffi.cdef("struct foo_s { long a; ...; };\n"
- "int (*foo)(struct foo_s);")
+ "static int (*foo)(struct foo_s);")
lib = ffi.verify("""
struct foo_s {
double b;
@@ -1084,7 +1074,7 @@
int foo1(struct foo_s s) {
return (int)s.a - (int)s.b;
}
- int (*foo)(struct foo_s s) = &foo1;
+ static int (*foo)(struct foo_s s) = &foo1;
""")
e = py.test.raises(NotImplementedError, lib.foo, "?")
msg = ("ctype 'struct foo_s' not supported as argument. It is a struct "
@@ -1454,7 +1444,7 @@
py.test.skip("_Bool not in MSVC")
ffi = FFI()
ffi.cdef("struct foo_s { _Bool x; };"
- "_Bool foo(_Bool); _Bool (*foop)(_Bool);")
+ "_Bool foo(_Bool); static _Bool (*foop)(_Bool);")
lib = ffi.verify("""
struct foo_s { _Bool x; };
int foo(int arg) {
@@ -1463,7 +1453,7 @@
_Bool _foofunc(_Bool x) {
return !x;
}
- _Bool (*foop)(_Bool) = _foofunc;
+ static _Bool (*foop)(_Bool) = _foofunc;
""")
p = ffi.new("struct foo_s *")
p.x = 1
@@ -1654,7 +1644,7 @@
def test_FILE_stored_explicitly():
ffi = FFI()
- ffi.cdef("int myprintf11(const char *, int); FILE *myfile;")
+ ffi.cdef("int myprintf11(const char *, int); extern FILE *myfile;")
lib = ffi.verify("""
#include <stdio.h>
FILE *myfile;
@@ -1680,19 +1670,19 @@
def test_global_array_with_missing_length():
ffi = FFI()
- ffi.cdef("int fooarray[];")
+ ffi.cdef("extern int fooarray[];")
lib = ffi.verify("int fooarray[50];")
assert repr(lib.fooarray).startswith("<cdata 'int *'")
def test_global_array_with_dotdotdot_length():
ffi = FFI()
- ffi.cdef("int fooarray[...];")
+ ffi.cdef("extern int fooarray[...];")
lib = ffi.verify("int fooarray[50];")
assert repr(lib.fooarray).startswith("<cdata 'int[50]'")
def test_bad_global_array_with_dotdotdot_length():
ffi = FFI()
- ffi.cdef("int fooarray[...];")
+ ffi.cdef("extern int fooarray[...];")
py.test.raises(VerificationError, ffi.verify, "char fooarray[23];")
def test_struct_containing_struct():
@@ -1813,7 +1803,7 @@
def test_callback_indirection():
ffi = FFI()
ffi.cdef("""
- int (*python_callback)(int how_many, int *values);
+ static int (*python_callback)(int how_many, int *values);
int (*const c_callback)(int,...); /* pass this ptr to C routines */
int some_c_function(int(*cb)(int,...));
""")
@@ -1947,24 +1937,24 @@
def test_bug_const_char_ptr_array_1():
ffi = FFI()
- ffi.cdef("""const char *a[...];""")
+ ffi.cdef("""extern const char *a[...];""")
lib = ffi.verify("""const char *a[5];""")
assert repr(ffi.typeof(lib.a)) == "<ctype 'char *[5]'>"
def test_bug_const_char_ptr_array_2():
from cffi import FFI # ignore warnings
ffi = FFI()
- ffi.cdef("""const int a[];""")
+ ffi.cdef("""extern const int a[];""")
lib = ffi.verify("""const int a[5];""")
assert repr(ffi.typeof(lib.a)) == "<ctype 'int *'>"
def _test_various_calls(force_libffi):
cdef_source = """
- int xvalue;
- long long ivalue, rvalue;
- float fvalue;
- double dvalue;
- long double Dvalue;
+ extern int xvalue;
+ extern long long ivalue, rvalue;
+ extern float fvalue;
+ extern double dvalue;
+ extern long double Dvalue;
signed char tf_bb(signed char x, signed char c);
unsigned char tf_bB(signed char x, unsigned char c);
short tf_bh(signed char x, short c);
@@ -2148,7 +2138,7 @@
# exported symbols as well. So we must not export a simple name
# like 'foo'!
ffi1 = FFI()
- ffi1.cdef("int foo_verify_dlopen_flags;")
+ ffi1.cdef("extern int foo_verify_dlopen_flags;")
lib1 = ffi1.verify("int foo_verify_dlopen_flags;",
flags=ffi1.RTLD_GLOBAL | ffi1.RTLD_LAZY)
@@ -2162,7 +2152,7 @@
def get_second_lib():
# Hack, using modulename makes the test fail
ffi2 = FFI()
- ffi2.cdef("int foo_verify_dlopen_flags;")
+ ffi2.cdef("extern int foo_verify_dlopen_flags;")
lib2 = ffi2.verify("int foo_verify_dlopen_flags;",
flags=ffi2.RTLD_GLOBAL | ffi2.RTLD_LAZY)
return lib2
diff --git a/extra_tests/cffi_tests/cffi1/test_dlopen.py
b/extra_tests/cffi_tests/cffi1/test_dlopen.py
--- a/extra_tests/cffi_tests/cffi1/test_dlopen.py
+++ b/extra_tests/cffi_tests/cffi1/test_dlopen.py
@@ -7,7 +7,7 @@
def test_simple():
ffi = FFI()
- ffi.cdef("int close(int); static const int BB = 42; int somevar;")
+ ffi.cdef("int close(int); static const int BB = 42; extern int somevar;")
target = udir.join('test_simple.py')
make_py_source(ffi, 'test_simple', str(target))
assert target.read() == r"""# auto-generated file
@@ -197,7 +197,7 @@
def test_global_var():
ffi = FFI()
- ffi.cdef("int myglob;")
+ ffi.cdef("extern int myglob;")
target = udir.join('test_global_var.py')
make_py_source(ffi, 'test_global_var', str(target))
assert target.read() == r"""# auto-generated file
diff --git a/extra_tests/cffi_tests/cffi1/test_new_ffi_1.py
b/extra_tests/cffi_tests/cffi1/test_new_ffi_1.py
--- a/extra_tests/cffi_tests/cffi1/test_new_ffi_1.py
+++ b/extra_tests/cffi_tests/cffi1/test_new_ffi_1.py
@@ -1780,7 +1780,7 @@
def test_import_from_lib(self):
ffi2 = cffi.FFI()
- ffi2.cdef("int myfunc(int); int myvar;\n#define MYFOO ...\n")
+ ffi2.cdef("int myfunc(int); extern int myvar;\n#define MYFOO ...\n")
outputfilename = recompile(ffi2, "_test_import_from_lib",
"int myfunc(int x) { return x + 1; }\n"
"int myvar = -5;\n"
diff --git a/extra_tests/cffi_tests/cffi1/test_re_python.py
b/extra_tests/cffi_tests/cffi1/test_re_python.py
--- a/extra_tests/cffi_tests/cffi1/test_re_python.py
+++ b/extra_tests/cffi_tests/cffi1/test_re_python.py
@@ -64,11 +64,11 @@
#define BIGNEG -420000000000L
int add42(int);
int add43(int, ...);
- int globalvar42;
+ extern int globalvar42;
const int globalconst42;
const char *const globalconsthello;
int no_such_function(int);
- int no_such_globalvar;
+ extern int no_such_globalvar;
struct foo_s;
typedef struct bar_s { int x; signed char a[]; } bar_t;
enum foo_e { AA, BB, CC };
@@ -76,6 +76,7 @@
struct with_union { union { int a; char b; }; };
union with_struct { struct { int a; char b; }; };
struct NVGcolor { union { float rgba[4]; struct { float r,g,b,a; }; }; };
+ typedef struct selfref { struct selfref *next; } *selfref_ptr_t;
""")
ffi.set_source('re_python_pysrc', None)
ffi.emit_python_code(str(tmpdir.join('re_python_pysrc.py')))
@@ -255,3 +256,8 @@
assert ffi.offsetof("struct NVGcolor", "g") == FLOAT
assert ffi.offsetof("struct NVGcolor", "b") == FLOAT * 2
assert ffi.offsetof("struct NVGcolor", "a") == FLOAT * 3
+
+def test_selfref():
+ # based on issue #429
+ from re_python_pysrc import ffi
+ ffi.new("selfref_ptr_t")
diff --git a/extra_tests/cffi_tests/cffi1/test_recompiler.py
b/extra_tests/cffi_tests/cffi1/test_recompiler.py
--- a/extra_tests/cffi_tests/cffi1/test_recompiler.py
+++ b/extra_tests/cffi_tests/cffi1/test_recompiler.py
@@ -35,8 +35,9 @@
source = 'extern "C" {\n%s\n}' % (source,)
elif sys.platform != 'win32':
# add '-Werror' to the existing 'extra_compile_args' flags
+ from extra_tests.cffi_tests.support import extra_compile_args
kwds['extra_compile_args'] = (kwds.get('extra_compile_args', []) +
- ['-Werror'])
+ extra_compile_args)
return _verify(ffi, module_name, source, *args, **kwds)
def test_set_source_no_slashes():
@@ -84,7 +85,7 @@
"(FUNCTION 1)(PRIMITIVE 7)(FUNCTION_END 1)(POINTER 0)")
def test_type_table_array():
- check_type_table("int a[100];",
+ check_type_table("extern int a[100];",
"(PRIMITIVE 7)(ARRAY 0)(None 100)")
def test_type_table_typedef():
@@ -159,7 +160,7 @@
def test_global_var_array():
ffi = FFI()
- ffi.cdef("int a[100];")
+ ffi.cdef("extern int a[100];")
lib = verify(ffi, 'test_global_var_array', 'int a[100] = { 9999 };')
lib.a[42] = 123456
assert lib.a[42] == 123456
@@ -183,7 +184,7 @@
def test_global_var_int():
ffi = FFI()
- ffi.cdef("int a, b, c;")
+ ffi.cdef("extern int a, b, c;")
lib = verify(ffi, 'test_global_var_int', 'int a = 999, b, c;')
assert lib.a == 999
lib.a -= 1001
@@ -284,7 +285,7 @@
def test_dir():
ffi = FFI()
- ffi.cdef("int ff(int); int aa; static const int my_constant;")
+ ffi.cdef("int ff(int); extern int aa; static const int my_constant;")
lib = verify(ffi, 'test_dir', """
#define my_constant (-45)
int aa;
@@ -406,7 +407,7 @@
def test_dotdotdot_global_array():
ffi = FFI()
- ffi.cdef("int aa[...]; int bb[...];")
+ ffi.cdef("extern int aa[...]; extern int bb[...];")
lib = verify(ffi, 'test_dotdotdot_global_array',
"int aa[41]; int bb[12];")
assert ffi.sizeof(lib.aa) == 41 * 4
@@ -561,37 +562,37 @@
def test_bad_size_of_global_1():
ffi = FFI()
- ffi.cdef("short glob;")
+ ffi.cdef("extern short glob;")
py.test.raises(VerificationError, verify, ffi,
"test_bad_size_of_global_1", "long glob;")
def test_bad_size_of_global_2():
ffi = FFI()
- ffi.cdef("int glob[10];")
+ ffi.cdef("extern int glob[10];")
py.test.raises(VerificationError, verify, ffi,
"test_bad_size_of_global_2", "int glob[9];")
def test_unspecified_size_of_global_1():
ffi = FFI()
- ffi.cdef("int glob[];")
+ ffi.cdef("extern int glob[];")
lib = verify(ffi, "test_unspecified_size_of_global_1", "int glob[10];")
assert ffi.typeof(lib.glob) == ffi.typeof("int *")
def test_unspecified_size_of_global_2():
ffi = FFI()
- ffi.cdef("int glob[][5];")
+ ffi.cdef("extern int glob[][5];")
lib = verify(ffi, "test_unspecified_size_of_global_2", "int glob[10][5];")
assert ffi.typeof(lib.glob) == ffi.typeof("int(*)[5]")
def test_unspecified_size_of_global_3():
ffi = FFI()
- ffi.cdef("int glob[][...];")
+ ffi.cdef("extern int glob[][...];")
lib = verify(ffi, "test_unspecified_size_of_global_3", "int glob[10][5];")
assert ffi.typeof(lib.glob) == ffi.typeof("int(*)[5]")
def test_unspecified_size_of_global_4():
ffi = FFI()
- ffi.cdef("int glob[...][...];")
+ ffi.cdef("extern int glob[...][...];")
lib = verify(ffi, "test_unspecified_size_of_global_4", "int glob[10][5];")
assert ffi.typeof(lib.glob) == ffi.typeof("int[10][5]")
@@ -814,7 +815,7 @@
def test_address_of_global_var():
ffi = FFI()
ffi.cdef("""
- long bottom, bottoms[2];
+ extern long bottom, bottoms[2];
long FetchRectBottom(void);
long FetchRectBottoms1(void);
#define FOOBAR 42
@@ -969,7 +970,7 @@
ffi = FFI()
ffi.cdef("""
typedef ... opaque_t;
- opaque_t globvar;
+ extern opaque_t globvar;
""")
lib = verify(ffi, 'test_variable_of_unknown_size', """
typedef char opaque_t[6];
@@ -1014,7 +1015,7 @@
def test_call_with_incomplete_structs():
ffi = FFI()
ffi.cdef("typedef struct {...;} foo_t; "
- "foo_t myglob; "
+ "extern foo_t myglob; "
"foo_t increment(foo_t s); "
"double getx(foo_t s);")
lib = verify(ffi, 'test_call_with_incomplete_structs', """
@@ -1058,7 +1059,7 @@
def test_global_var_array_2():
ffi = FFI()
- ffi.cdef("int a[...][...];")
+ ffi.cdef("extern int a[...][...];")
lib = verify(ffi, 'test_global_var_array_2', 'int a[10][8];')
lib.a[9][7] = 123456
assert lib.a[9][7] == 123456
@@ -1071,7 +1072,7 @@
def test_global_var_array_3():
ffi = FFI()
- ffi.cdef("int a[][...];")
+ ffi.cdef("extern int a[][...];")
lib = verify(ffi, 'test_global_var_array_3', 'int a[10][8];')
lib.a[9][7] = 123456
assert lib.a[9][7] == 123456
@@ -1082,7 +1083,7 @@
def test_global_var_array_4():
ffi = FFI()
- ffi.cdef("int a[10][...];")
+ ffi.cdef("extern int a[10][...];")
lib = verify(ffi, 'test_global_var_array_4', 'int a[10][8];')
lib.a[9][7] = 123456
assert lib.a[9][7] == 123456
@@ -1205,7 +1206,7 @@
def test_import_from_lib():
ffi = FFI()
- ffi.cdef("int mybar(int); int myvar;\n#define MYFOO ...")
+ ffi.cdef("int mybar(int); static int myvar;\n#define MYFOO ...")
lib = verify(ffi, 'test_import_from_lib',
"#define MYFOO 42\n"
"static int mybar(int x) { return x + 1; }\n"
@@ -1221,7 +1222,7 @@
def test_macro_var_callback():
ffi = FFI()
- ffi.cdef("int my_value; int *(*get_my_value)(void);")
+ ffi.cdef("extern int my_value; extern int *(*get_my_value)(void);")
lib = verify(ffi, 'test_macro_var_callback',
"int *(*get_my_value)(void);\n"
"#define my_value (*get_my_value())")
@@ -1336,7 +1337,7 @@
def test_const_function_type_args():
ffi = FFI()
- ffi.cdef("""int (*foobar)(const int a, const int *b, const int c[]);""")
+ ffi.cdef("""extern int(*foobar)(const int a,const int*b,const int c[]);""")
lib = verify(ffi, 'test_const_function_type_args', """
int (*foobar)(const int a, const int *b, const int c[]);
""")
@@ -1626,7 +1627,7 @@
def test_extern_python_bogus_name():
ffi = FFI()
- ffi.cdef("int abc;")
+ ffi.cdef("extern int abc;")
lib = verify(ffi, 'test_extern_python_bogus_name', "int abc;")
def fn():
pass
@@ -1787,8 +1788,8 @@
ffi.cdef("""
extern "Python" int __stdcall foo(int);
extern "Python" int WINAPI bar(int);
- int (__stdcall * mycb1)(int);
- int indirect_call(int);
+ static int (__stdcall * mycb1)(int);
+ static int indirect_call(int);
""")
lib = verify(ffi, 'test_extern_python_stdcall', """
#ifndef _MSC_VER
@@ -1856,7 +1857,7 @@
def test_introspect_global_var():
ffi = FFI()
- ffi.cdef("float g1;")
+ ffi.cdef("extern float g1;")
lib = verify(ffi, 'test_introspect_global_var', """
float g1;
""")
@@ -1867,7 +1868,7 @@
def test_introspect_global_var_array():
ffi = FFI()
- ffi.cdef("float g1[100];")
+ ffi.cdef("extern float g1[100];")
lib = verify(ffi, 'test_introspect_global_var_array', """
float g1[100];
""")
@@ -2039,7 +2040,7 @@
ffi.cdef("float _Complex f1(float a, float b);");
lib = verify(ffi, "test_function_returns_float_complex", """
#include <complex.h>
- static float _Complex f1(float a, float b) { return a + I*2.0*b; }
+ static float _Complex f1(float a, float b) { return a + I*2.0f*b; }
""", no_cpp=True) # <complex.h> fails on some systems with C++
result = lib.f1(1.25, 5.1)
assert type(result) == complex
@@ -2090,7 +2091,7 @@
ffi = FFI()
ffi.cdef("""
typedef int foo_t[...], bar_t[...];
- int gv[...];
+ extern int gv[...];
typedef int mat_t[...][...];
typedef int vmat_t[][...];
""")
diff --git a/extra_tests/cffi_tests/cffi1/test_verify1.py
b/extra_tests/cffi_tests/cffi1/test_verify1.py
--- a/extra_tests/cffi_tests/cffi1/test_verify1.py
+++ b/extra_tests/cffi_tests/cffi1/test_verify1.py
@@ -5,7 +5,7 @@
from cffi import CDefError
from cffi import recompiler
from extra_tests.cffi_tests.support import *
-from extra_tests.cffi_tests.support import _verify
+from extra_tests.cffi_tests.support import _verify, extra_compile_args
import _cffi_backend
lib_m = ['m']
@@ -14,18 +14,6 @@
import distutils.ccompiler
if distutils.ccompiler.get_default_compiler() == 'msvc':
lib_m = ['msvcrt']
- extra_compile_args = [] # no obvious -Werror equivalent on MSVC
-else:
- if (sys.platform == 'darwin' and
- [int(x) for x in os.uname()[2].split('.')] >= [11, 0, 0]):
- # assume a standard clang or gcc
- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
- # special things for clang
- extra_compile_args.append('-Qunused-arguments')
- else:
- # assume a standard gcc
- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion',
- '-Wno-unused-parameter']
class FFI(FFI):
error = _cffi_backend.FFI.error
@@ -268,7 +256,7 @@
def test_var_signed_integer_types():
ffi = FFI()
lst = all_signed_integer_types(ffi)
- csource = "\n".join(["%s somevar_%s;" % (tp, tp.replace(' ', '_'))
+ csource = "\n".join(["static %s somevar_%s;" % (tp, tp.replace(' ', '_'))
for tp in lst])
ffi.cdef(csource)
lib = ffi.verify(csource)
@@ -287,7 +275,7 @@
def test_var_unsigned_integer_types():
ffi = FFI()
lst = all_unsigned_integer_types(ffi)
- csource = "\n".join(["%s somevar_%s;" % (tp, tp.replace(' ', '_'))
+ csource = "\n".join(["static %s somevar_%s;" % (tp, tp.replace(' ', '_'))
for tp in lst])
ffi.cdef(csource)
lib = ffi.verify(csource)
@@ -791,8 +779,8 @@
def test_access_variable():
ffi = FFI()
- ffi.cdef("int foo(void);\n"
- "int somenumber;")
+ ffi.cdef("static int foo(void);\n"
+ "static int somenumber;")
lib = ffi.verify("""
static int somenumber = 2;
static int foo(void) {
@@ -809,7 +797,7 @@
def test_access_address_of_variable():
# access the address of 'somenumber': need a trick
ffi = FFI()
- ffi.cdef("int somenumber; static int *const somenumberptr;")
+ ffi.cdef("static int somenumber; static int *const somenumberptr;")
lib = ffi.verify("""
static int somenumber = 2;
#define somenumberptr (&somenumber)
@@ -821,8 +809,8 @@
def test_access_array_variable(length=5):
ffi = FFI()
- ffi.cdef("int foo(int);\n"
- "int somenumber[%s];" % (length,))
+ ffi.cdef("static int foo(int);\n"
+ "static int somenumber[%s];" % (length,))
lib = ffi.verify("""
static int somenumber[] = {2, 2, 3, 4, 5};
static int foo(int i) {
@@ -853,8 +841,8 @@
def test_access_struct_variable():
ffi = FFI()
ffi.cdef("struct foo { int x; ...; };\n"
- "int foo(int);\n"
- "struct foo stuff;")
+ "static int foo(int);\n"
+ "static struct foo stuff;")
lib = ffi.verify("""
struct foo { int x, y, z; };
static struct foo stuff = {2, 5, 8};
@@ -878,9 +866,9 @@
def test_access_callback():
ffi = FFI()
- ffi.cdef("int (*cb)(int);\n"
- "int foo(int);\n"
- "void reset_cb(void);")
+ ffi.cdef("static int (*cb)(int);\n"
+ "static int foo(int);\n"
+ "static void reset_cb(void);")
lib = ffi.verify("""
static int g(int x) { return x * 7; }
static int (*cb)(int);
@@ -896,9 +884,9 @@
def test_access_callback_function_typedef():
ffi = FFI()
ffi.cdef("typedef int mycallback_t(int);\n"
- "mycallback_t *cb;\n"
- "int foo(int);\n"
- "void reset_cb(void);")
+ "static mycallback_t *cb;\n"
+ "static int foo(int);\n"
+ "static void reset_cb(void);")
lib = ffi.verify("""
static int g(int x) { return x * 7; }
static int (*cb)(int);
@@ -1039,7 +1027,7 @@
def test_autofilled_struct_as_argument_dynamic():
ffi = FFI()
ffi.cdef("struct foo_s { long a; ...; };\n"
- "int (*foo)(struct foo_s);")
+ "static int (*foo)(struct foo_s);")
lib = ffi.verify("""
struct foo_s {
double b;
@@ -1048,7 +1036,7 @@
int foo1(struct foo_s s) {
return (int)s.a - (int)s.b;
}
- int (*foo)(struct foo_s s) = &foo1;
+ static int (*foo)(struct foo_s s) = &foo1;
""")
e = py.test.raises(NotImplementedError, lib.foo, "?")
msg = ("ctype 'struct foo_s' not supported as argument. It is a struct "
@@ -1424,7 +1412,7 @@
py.test.skip("_Bool not in MSVC")
ffi = FFI()
ffi.cdef("struct foo_s { _Bool x; };"
- "_Bool foo(_Bool); _Bool (*foop)(_Bool);")
+ "_Bool foo(_Bool); static _Bool (*foop)(_Bool);")
lib = ffi.verify("""
struct foo_s { _Bool x; };
int foo(int arg) {
@@ -1433,7 +1421,7 @@
_Bool _foofunc(_Bool x) {
return !x;
}
- _Bool (*foop)(_Bool) = _foofunc;
+ static _Bool (*foop)(_Bool) = _foofunc;
""")
p = ffi.new("struct foo_s *")
p.x = 1
@@ -1618,7 +1606,7 @@
def test_FILE_stored_explicitly():
ffi = FFI()
- ffi.cdef("int myprintf11(const char *, int); FILE *myfile;")
+ ffi.cdef("int myprintf11(const char *, int); extern FILE *myfile;")
lib = ffi.verify("""
#include <stdio.h>
FILE *myfile;
@@ -1644,13 +1632,13 @@
def test_global_array_with_missing_length():
ffi = FFI()
- ffi.cdef("int fooarray[];")
+ ffi.cdef("extern int fooarray[];")
lib = ffi.verify("int fooarray[50];")
assert repr(lib.fooarray).startswith("<cdata 'int *'")
def test_global_array_with_dotdotdot_length():
ffi = FFI()
- ffi.cdef("int fooarray[...];")
+ ffi.cdef("extern int fooarray[...];")
lib = ffi.verify("int fooarray[50];")
assert repr(lib.fooarray).startswith("<cdata 'int[50]'")
@@ -1658,7 +1646,7 @@
py.test.xfail("was detected only because 23 bytes cannot be divided by 4; "
"redo more generally")
ffi = FFI()
- ffi.cdef("int fooarray[...];")
+ ffi.cdef("extern int fooarray[...];")
py.test.raises(VerificationError, ffi.verify, "char fooarray[23];")
def test_struct_containing_struct():
@@ -1779,7 +1767,7 @@
def test_callback_indirection():
ffi = FFI()
ffi.cdef("""
- int (*python_callback)(int how_many, int *values);
+ static int (*python_callback)(int how_many, int *values);
int (*const c_callback)(int,...); /* pass this ptr to C routines */
int some_c_function(int(*cb)(int,...));
""")
@@ -1913,23 +1901,23 @@
def test_bug_const_char_ptr_array_1():
ffi = FFI()
- ffi.cdef("""const char *a[...];""")
+ ffi.cdef("""extern const char *a[...];""")
lib = ffi.verify("""const char *a[5];""")
assert repr(ffi.typeof(lib.a)) == "<ctype 'char *[5]'>"
def test_bug_const_char_ptr_array_2():
ffi = FFI()
- ffi.cdef("""const int a[];""")
+ ffi.cdef("""extern const int a[];""")
lib = ffi.verify("""const int a[5];""")
assert repr(ffi.typeof(lib.a)) == "<ctype 'int *'>"
def _test_various_calls(force_libffi):
cdef_source = """
- int xvalue;
- long long ivalue, rvalue;
- float fvalue;
- double dvalue;
- long double Dvalue;
+ extern int xvalue;
+ extern long long ivalue, rvalue;
+ extern float fvalue;
+ extern double dvalue;
+ extern long double Dvalue;
signed char tf_bb(signed char x, signed char c);
unsigned char tf_bB(signed char x, unsigned char c);
short tf_bh(signed char x, short c);
@@ -2112,7 +2100,7 @@
old = sys.getdlopenflags()
try:
ffi1 = FFI()
- ffi1.cdef("int foo_verify_dlopen_flags_1;")
+ ffi1.cdef("extern int foo_verify_dlopen_flags_1;")
sys.setdlopenflags(ffi1.RTLD_GLOBAL | ffi1.RTLD_NOW)
lib1 = ffi1.verify("int foo_verify_dlopen_flags_1;")
finally:
@@ -2253,7 +2241,7 @@
def test_macro_var():
ffi = FFI()
- ffi.cdef("int myarray[50], my_value;")
+ ffi.cdef("extern int myarray[50], my_value;")
lib = ffi.verify("""
int myarray[50];
int *get_my_value(void) {
diff --git a/extra_tests/cffi_tests/embedding/add1.py
b/extra_tests/cffi_tests/embedding/add1.py
--- a/extra_tests/cffi_tests/embedding/add1.py
+++ b/extra_tests/cffi_tests/embedding/add1.py
@@ -12,7 +12,11 @@
sys.stdout.write("preparing")
for i in range(3):
sys.stdout.flush()
- time.sleep(0.2)
+ # Windows: sometimes time.sleep() doesn't sleep at all.
+ # This appears to occur on recent versions of python only.
+ t_end = time.time() + 0.19
+ while time.time() < t_end:
+ time.sleep(0.2)
sys.stdout.write(".")
sys.stdout.write("\n")
diff --git a/extra_tests/cffi_tests/embedding/add_recursive.py
b/extra_tests/cffi_tests/embedding/add_recursive.py
--- a/extra_tests/cffi_tests/embedding/add_recursive.py
+++ b/extra_tests/cffi_tests/embedding/add_recursive.py
@@ -4,7 +4,7 @@
ffi = cffi.FFI()
ffi.embedding_api("""
- int (*my_callback)(int);
+ extern int (*my_callback)(int);
int add_rec(int, int);
""")
diff --git a/extra_tests/cffi_tests/embedding/test_thread.py
b/extra_tests/cffi_tests/embedding/test_thread.py
--- a/extra_tests/cffi_tests/embedding/test_thread.py
+++ b/extra_tests/cffi_tests/embedding/test_thread.py
@@ -22,17 +22,21 @@
add1_cffi = self.prepare_module('add1')
add2_cffi = self.prepare_module('add2')
self.compile('thread2-test', [add1_cffi, add2_cffi], threads=True)
- output = self.execute('thread2-test')
- output = self._take_out(output, "preparing")
- output = self._take_out(output, ".")
- output = self._take_out(output, ".")
- # at least the 3rd dot should be after everything from ADD2
- assert output == ("starting\n"
- "prepADD2\n"
- "adding 1000 and 200 and 30\n"
- ".\n"
- "adding 40 and 2\n"
- "done\n")
+ for i in range(3):
+ output = self.execute('thread2-test')
+ print('='*79)
+ print(output)
+ print('='*79)
+ output = self._take_out(output, "preparing")
+ output = self._take_out(output, ".")
+ output = self._take_out(output, ".")
+ # at least the 3rd dot should be after everything from ADD2
+ assert output == ("starting\n"
+ "prepADD2\n"
+ "adding 1000 and 200 and 30\n"
+ ".\n"
+ "adding 40 and 2\n"
+ "done\n")
def test_alt_issue(self):
add1_cffi = self.prepare_module('add1')
diff --git a/extra_tests/cffi_tests/support.py
b/extra_tests/cffi_tests/support.py
--- a/extra_tests/cffi_tests/support.py
+++ b/extra_tests/cffi_tests/support.py
@@ -1,5 +1,5 @@
# Generated by pypy/tool/import_cffi.py
-import sys
+import sys, os
if sys.version_info < (3,):
__all__ = ['u']
@@ -87,3 +87,24 @@
if not name.startswith('_') and not hasattr(module.ffi, name):
setattr(ffi, name, NotImplemented)
return module.lib
+
+
+# For testing, we call gcc with "-Werror". This is fragile because newer
+# versions of gcc are always better at producing warnings, particularly for
+# auto-generated code. We need here to adapt and silence them as needed.
+
+if sys.platform == 'win32':
+ extra_compile_args = [] # no obvious -Werror equivalent on MSVC
+else:
+ if (sys.platform == 'darwin' and
+ [int(x) for x in os.uname()[2].split('.')] >= [11, 0, 0]):
+ # assume a standard clang or gcc
+ extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion',
+ '-Wno-unreachable-code']
+ # special things for clang
+ extra_compile_args.append('-Qunused-arguments')
+ else:
+ # assume a standard gcc
+ extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion',
+ '-Wno-unused-parameter',
+ '-Wno-unreachable-code']
diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py
b/lib-python/2.7/distutils/sysconfig_pypy.py
--- a/lib-python/2.7/distutils/sysconfig_pypy.py
+++ b/lib-python/2.7/distutils/sysconfig_pypy.py
@@ -86,7 +86,7 @@
arch = platform.machine()
g['LDSHARED'] += ' -undefined dynamic_lookup'
g['CC'] += ' -arch %s' % (arch,)
- g['MACOSX_DEPLOYMENT_TARGET'] = '10.14'
+ g['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
global _config_vars
_config_vars = g
diff --git a/lib-python/2.7/ensurepip/__init__.py
b/lib-python/2.7/ensurepip/__init__.py
--- a/lib-python/2.7/ensurepip/__init__.py
+++ b/lib-python/2.7/ensurepip/__init__.py
@@ -12,9 +12,9 @@
__all__ = ["version", "bootstrap"]
-_SETUPTOOLS_VERSION = "28.8.0"
+_SETUPTOOLS_VERSION = "41.2.0"
-_PIP_VERSION = "9.0.1"
+_PIP_VERSION = "19.2.3"
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION),
@@ -28,8 +28,8 @@
sys.path = additional_paths + sys.path
# Install the bundled software
- import pip
- pip.main(args)
+ import pip._internal
+ return pip._internal.main(args)
def version():
diff --git a/lib-python/2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl
b/lib-python/2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl
new file mode 100644
index
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8118df8ac1940f8c6cb410fbc18e5fae59872b95
GIT binary patch
[cut]
diff --git a/lib-python/2.7/ensurepip/_bundled/pip-9.0.1-py2.py3-none-any.whl
b/lib-python/2.7/ensurepip/_bundled/pip-9.0.1-py2.py3-none-any.whl
deleted file mode 100644
index
4b8ecc69db7e37fc6dd7b6dd8f690508f42866a1..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
[cut]
diff --git
a/lib-python/2.7/ensurepip/_bundled/setuptools-28.8.0-py2.py3-none-any.whl
b/lib-python/2.7/ensurepip/_bundled/setuptools-28.8.0-py2.py3-none-any.whl
deleted file mode 100644
index
502e3cb418c154872ad6e677ef8b63557b38ec35..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
[cut]
diff --git
a/lib-python/2.7/ensurepip/_bundled/setuptools-41.2.0-py2.py3-none-any.whl
b/lib-python/2.7/ensurepip/_bundled/setuptools-41.2.0-py2.py3-none-any.whl
new file mode 100644
index
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..82df6f63f4ee97380af0a29d8825ae775333b86d
GIT binary patch
[cut]
diff --git a/lib-python/2.7/sysconfig.py b/lib-python/2.7/sysconfig.py
--- a/lib-python/2.7/sysconfig.py
+++ b/lib-python/2.7/sysconfig.py
@@ -382,6 +382,11 @@
vars['EXE'] = '.exe'
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
+ # pypy only: give us control over the ABI tag in a wheel name
+ if '__pypy__' in sys.builtin_module_names:
+ import imp
+ so_ext = imp.get_suffixes()[0][0]
+ vars['SOABI']= '-'.join(so_ext.split('.')[1].split('-')[:2])
#
# public APIs
diff --git a/lib-python/2.7/test/test_dictviews.py
b/lib-python/2.7/test/test_dictviews.py
--- a/lib-python/2.7/test/test_dictviews.py
+++ b/lib-python/2.7/test/test_dictviews.py
@@ -182,7 +182,7 @@
def test_deeply_nested_repr(self):
d = {}
- for i in range(sys.getrecursionlimit() + 100):
+ for i in range(sys.getrecursionlimit() + 200):
d = {42: d.viewvalues()}
self.assertRaises(RuntimeError, repr, d)
diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py
b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
--- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
@@ -2,8 +2,18 @@
import time
import thread as _thread
import weakref
-from _pypy_openssl import ffi
-from _pypy_openssl import lib
+
+try:
+ from _pypy_openssl import ffi
+ from _pypy_openssl import lib
+except ImportError as e:
+ import os
+ msg = "\n\nThe _ssl cffi module either doesn't exist or is incompatible
with your machine's shared libraries.\n" + \
+ "If you have a compiler installed, you can try to rebuild it by
running:\n" + \
+ "cd %s\n" %
os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) + \
+ "%s _ssl_build.py\n" % sys.executable
+ raise ImportError(str(e) + msg)
+
from _cffi_ssl._stdssl.certificate import (_test_decode_cert,
_decode_certificate, _certificate_to_der)
from _cffi_ssl._stdssl.utility import (_str_with_len, _bytes_with_len,
diff --git a/lib_pypy/_ctypes/array.py b/lib_pypy/_ctypes/array.py
--- a/lib_pypy/_ctypes/array.py
+++ b/lib_pypy/_ctypes/array.py
@@ -267,6 +267,8 @@
raise TypeError("Can't multiply a ctypes type by a non-integer")
if length < 0:
raise ValueError("Array length must be >= 0")
+ if length * base._sizeofinstances() > sys.maxsize:
+ raise OverflowError("array too large")
key = (base, length)
try:
return ARRAY_CACHE[key]
diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py
--- a/lib_pypy/_curses_build.py
+++ b/lib_pypy/_curses_build.py
@@ -1,18 +1,42 @@
-from cffi import FFI
+from cffi import FFI, VerificationError
import os
-# On some systems, the ncurses library is
-# located at /usr/include/ncurses, so we must check this case.
-# Let's iterate over well known paths
-incdirs = []
-for _path in ['/usr/include', '/usr/include/ncurses']:
- if os.path.isfile(os.path.join(_path, 'panel.h')):
- incdirs.append(_path)
- break
+version_str = '''
+ static const int NCURSES_VERSION_MAJOR;
+ static const int NCURSES_VERSION_MINOR;
+'''
+
+version = (0, 0)
+def find_library(options):
+ global version
+ for library in options:
+ ffi = FFI()
+ ffi.cdef(version_str)
+ ffi.set_source("_curses_cffi_check", version_str, libraries=[library])
+ try:
+ ffi.compile()
+ import _curses_cffi_check
+ lib = _curses_cffi_check.lib
+ version = (lib.NCURSES_VERSION_MAJOR, lib.NCURSES_VERSION_MINOR)
+ except VerificationError as e:
+ e_last = e
+ continue
+ else:
+ return library
+
+ # If none of the options is available, present the user a meaningful
+ # error message
+ raise e_last
+
+def find_curses_include_dirs():
+ if os.path.exists('/usr/include/ncurses'):
+ return ['/usr/include/ncurses']
+ if os.path.exists('/usr/include/ncursesw'):
+ return ['/usr/include/ncursesw']
+ return []
ffi = FFI()
-
ffi.set_source("_curses_cffi", """
#ifdef __APPLE__
/* the following define is necessary for OS X 10.6+; without it, the
@@ -59,8 +83,9 @@
void _m_getsyx(int *yx) {
getsyx(yx[0], yx[1]);
}
-""", include_dirs=incdirs,
- libraries=['ncurses', 'panel'])
+""", libraries=[find_library(['ncurses', 'ncursesw']),
+ find_library(['panel', 'panelw'])],
+ include_dirs=find_curses_include_dirs())
ffi.cdef("""
@@ -82,6 +107,7 @@
static const int ERR, OK;
static const int TRUE, FALSE;
static const int KEY_MIN, KEY_MAX;
+static const int KEY_CODE_YES;
static const int COLOR_BLACK;
static const int COLOR_RED;
@@ -141,11 +167,11 @@
int setupterm(char *, int, int *);
-WINDOW *stdscr;
-int COLORS;
-int COLOR_PAIRS;
-int COLS;
-int LINES;
+extern WINDOW *stdscr;
+extern int COLORS;
+extern int COLOR_PAIRS;
+extern int COLS;
+extern int LINES;
int baudrate(void);
int beep(void);
@@ -321,7 +347,7 @@
#define _m_NetBSD ...
int _m_ispad(WINDOW *);
-chtype acs_map[];
+extern chtype acs_map[];
// For _curses_panel:
@@ -346,6 +372,14 @@
void _m_getsyx(int *yx);
""")
+if version > (5, 7):
+ ffi.cdef("""
+typedef int... wint_t;
+int wget_wch(WINDOW *, wint_t *);
+int mvwget_wch(WINDOW *, int, int, wint_t *);
+int unget_wch(const wchar_t);
+""")
+
if __name__ == "__main__":
ffi.compile()
diff --git a/lib_pypy/cffi.egg-info/PKG-INFO b/lib_pypy/cffi.egg-info/PKG-INFO
--- a/lib_pypy/cffi.egg-info/PKG-INFO
+++ b/lib_pypy/cffi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: cffi
-Version: 1.13.0
+Version: 1.13.2
Summary: Foreign Function Interface for Python calling C code.
Home-page: http://cffi.readthedocs.org
Author: Armin Rigo, Maciej Fijalkowski
diff --git a/lib_pypy/cffi/__init__.py b/lib_pypy/cffi/__init__.py
--- a/lib_pypy/cffi/__init__.py
+++ b/lib_pypy/cffi/__init__.py
@@ -5,8 +5,8 @@
from .error import CDefError, FFIError, VerificationError, VerificationMissing
from .error import PkgConfigError
-__version__ = "1.13.0"
-__version_info__ = (1, 13, 0)
+__version__ = "1.13.2"
+__version_info__ = (1, 13, 2)
# The verifier module file names are based on the CRC32 of a string that
# contains the following version number. It may be older than __version__
diff --git a/lib_pypy/cffi/_cffi_include.h b/lib_pypy/cffi/_cffi_include.h
--- a/lib_pypy/cffi/_cffi_include.h
+++ b/lib_pypy/cffi/_cffi_include.h
@@ -261,12 +261,12 @@
return (int)_cffi_to_c_wchar3216_t(o);
}
-_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x)
+_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(unsigned int x)
{
if (sizeof(_cffi_wchar_t) == 4)
return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
else
- return _cffi_from_c_wchar3216_t(x);
+ return _cffi_from_c_wchar3216_t((int)x);
}
diff --git a/lib_pypy/cffi/_embedding.h b/lib_pypy/cffi/_embedding.h
--- a/lib_pypy/cffi/_embedding.h
+++ b/lib_pypy/cffi/_embedding.h
@@ -224,7 +224,7 @@
if (f != NULL && f != Py_None) {
PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME
- "\ncompiled with cffi version: 1.13.0"
+ "\ncompiled with cffi version: 1.13.2"
"\n_cffi_backend module: ", f);
modules = PyImport_GetModuleDict();
mod = PyDict_GetItemString(modules, "_cffi_backend");
@@ -327,13 +327,15 @@
#endif
/* call Py_InitializeEx() */
- {
- PyGILState_STATE state = PyGILState_UNLOCKED;
- if (!Py_IsInitialized())
- _cffi_py_initialize();
- else
- state = PyGILState_Ensure();
-
+ if (!Py_IsInitialized()) {
+ _cffi_py_initialize();
+ PyEval_InitThreads();
+ PyEval_SaveThread(); /* release the GIL */
+ /* the returned tstate must be the one that has been stored into the
+ autoTLSkey by _PyGILState_Init() called from Py_Initialize(). */
+ }
+ else {
+ PyGILState_STATE state = PyGILState_Ensure();
PyEval_InitThreads();
PyGILState_Release(state);
}
diff --git a/lib_pypy/cffi/cparser.py b/lib_pypy/cffi/cparser.py
--- a/lib_pypy/cffi/cparser.py
+++ b/lib_pypy/cffi/cparser.py
@@ -156,6 +156,13 @@
"confuse pre-parsing.")
break
+def _warn_for_non_extern_non_static_global_variable(decl):
+ if not decl.storage:
+ import warnings
+ warnings.warn("Global variable '%s' in cdef(): for consistency "
+ "with C it should have a storage class specifier "
+ "(usually 'extern')" % (decl.name,))
+
def _preprocess(csource):
# Remove comments. NOTE: this only work because the cdef() section
# should not contain any string literal!
@@ -506,6 +513,7 @@
if (quals & model.Q_CONST) and not tp.is_array_type:
self._declare('constant ' + decl.name, tp, quals=quals)
else:
+ _warn_for_non_extern_non_static_global_variable(decl)
self._declare('variable ' + decl.name, tp, quals=quals)
def parse_type(self, cdecl):
diff --git a/lib_pypy/pyrepl/historical_reader.py
b/lib_pypy/pyrepl/historical_reader.py
--- a/lib_pypy/pyrepl/historical_reader.py
+++ b/lib_pypy/pyrepl/historical_reader.py
@@ -111,7 +111,7 @@
r.isearch_term = ''
r.dirty = 1
r.push_input_trans(r.isearch_trans)
-
+
class reverse_history_isearch(commands.Command):
def do(self):
@@ -217,7 +217,7 @@
self.isearch_trans = input.KeymapTranslator(
isearch_keymap, invalid_cls=isearch_end,
character_cls=isearch_add_character)
-
+
def select_item(self, i):
self.transient_history[self.historyi] = self.get_unicode()
buf = self.transient_history.get(i)
@@ -302,7 +302,7 @@
reader.ps1 = "h**> "
reader.ps2 = "h/*> "
reader.ps3 = "h|*> "
- reader.ps4 = "h\*> "
+ reader.ps4 = r"h\*> "
while reader.readline():
pass
diff --git a/lib_pypy/pyrepl/keymap.py b/lib_pypy/pyrepl/keymap.py
--- a/lib_pypy/pyrepl/keymap.py
+++ b/lib_pypy/pyrepl/keymap.py
@@ -58,7 +58,7 @@
"'":"'",
'"':'"',
'a':'\a',
- 'b':'\h',
+ 'b':'\b',
'e':'\033',
'f':'\f',
'n':'\n',
diff --git a/lib_pypy/pyrepl/reader.py b/lib_pypy/pyrepl/reader.py
--- a/lib_pypy/pyrepl/reader.py
+++ b/lib_pypy/pyrepl/reader.py
@@ -232,7 +232,7 @@
self.ps1 = "->> "
self.ps2 = "/>> "
self.ps3 = "|.. "
- self.ps4 = "\__ "
+ self.ps4 = r"\__ "
self.kill_ring = []
self.arg = None
self.finished = 0
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -37,7 +37,7 @@
"binascii", "_multiprocessing", '_warnings', "_collections",
"_multibytecodec", "micronumpy", "_continuation", "_cffi_backend",
"_csv", "_cppyy", "_pypyjson", "_jitlog",
- #" _ssl", "_hashlib", "crypt"
+ # "_hashlib", "crypt"
])
import rpython.rlib.rvmprof.cintf
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -114,8 +114,8 @@
return PyPyModule(path, parent)
def is_applevel(item):
- from pypy.tool.pytest.apptest import AppTestFunction
- return isinstance(item, AppTestFunction)
+ from pypy.tool.pytest.apptest import AppTestMethod
+ return isinstance(item, AppTestMethod)
def pytest_collection_modifyitems(config, items):
if config.getoption('runappdirect') or config.getoption('direct_apptest'):
@@ -145,8 +145,6 @@
def funcnamefilter(self, name):
if name.startswith('test_'):
return self.accept_regular_test()
- if name.startswith('app_test_'):
- return True
return False
def classnamefilter(self, name):
@@ -161,13 +159,6 @@
if name.startswith('AppTest'):
from pypy.tool.pytest.apptest import AppClassCollector
return AppClassCollector(name, parent=self)
-
- elif hasattr(obj, 'func_code') and self.funcnamefilter(name):
- if name.startswith('app_test_'):
- assert not obj.func_code.co_flags & 32, \
- "generator app level functions? you must be joking"
- from pypy.tool.pytest.apptest import AppTestFunction
- return AppTestFunction(name, parent=self)
return super(PyPyModule, self).makeitem(name, obj)
def skip_on_missing_buildoption(**ropts):
@@ -186,27 +177,18 @@
py.test.skip("need translated pypy with: %s, got %s"
%(ropts,options))
-class LazyObjSpaceGetter(object):
- def __get__(self, obj, cls=None):
- from pypy.tool.pytest.objspace import gettestobjspace
- space = gettestobjspace()
- if cls:
- cls.space = space
- return space
-
-
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
appclass = item.getparent(py.test.Class)
if appclass is not None:
+ from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
- spaceconfig = getattr(appclass.obj, 'spaceconfig', None)
- if spaceconfig is not None:
- from pypy.tool.pytest.objspace import gettestobjspace
- appclass.obj.space = gettestobjspace(**spaceconfig)
- else:
- appclass.obj.space = LazyObjSpaceGetter()
+ spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
+ config = item.config
+ if not (config.getoption('runappdirect') or
config.getoption('direct_apptest')):
+ spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
+ appclass.obj.space = gettestobjspace(**spaceconfig)
appclass.obj.runappdirect = option.runappdirect
def pytest_ignore_collect(path, config):
diff --git a/pypy/doc/commandline_ref.rst b/pypy/doc/commandline_ref.rst
--- a/pypy/doc/commandline_ref.rst
+++ b/pypy/doc/commandline_ref.rst
@@ -9,3 +9,4 @@
man/pypy.1.rst
man/pypy3.1.rst
+ jit_help.rst
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -71,9 +71,9 @@
# module/cpyext/include/patchlevel.h
#
# The short X.Y version.
-version = '7.2'
+version = '7.3'
# The full version, including alpha/beta/rc tags.
-release = '7.2.0'
+release = '7.3.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pypy/doc/index-of-whatsnew.rst b/pypy/doc/index-of-whatsnew.rst
--- a/pypy/doc/index-of-whatsnew.rst
+++ b/pypy/doc/index-of-whatsnew.rst
@@ -42,7 +42,9 @@
-------------------------------
.. toctree::
- whatsnew-pypy3-head.rst
+ whatsnew-pypy3-head.rst
+ whatsnew-pypy3-7.2.0.rst
+ whatsnew-pypy3-7.1.0.rst
CPython 3.5 compatible versions
-------------------------------
@@ -50,6 +52,8 @@
.. toctree::
whatsnew-pypy3-7.0.0.rst
+ whatsnew-pypy3-6.0.0.rst
+ whatsnew-pypy3-5.10.0.rst
whatsnew-pypy3-5.9.0.rst
whatsnew-pypy3-5.8.0.rst
whatsnew-pypy3-5.7.0.rst
@@ -62,10 +66,4 @@
whatsnew-pypy3-5.5.0.rst
whatsnew-pypy3-5.1.1-alpha1.rst
-CPython 3.2 compatible versions
--------------------------------
-.. toctree::
-
- whatsnew-pypy3-2.4.0.rst
- whatsnew-pypy3-2.3.1.rst
diff --git a/pypy/doc/jit_help.rst b/pypy/doc/jit_help.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/jit_help.rst
@@ -0,0 +1,78 @@
+========
+JIT help
+========
+
+.. note this is from ``pypy --jit help``
+
+Advanced JIT options
+====================
+
+``<pypy> --jit`` [*options*] where *options* is a comma-separated list of
+``OPTION=VALUE``:
+
+ decay=N
+ amount to regularly decay counters by (0=none, 1000=max) (default 40)
+
+ disable_unrolling=N
+ after how many operations we should not unroll (default 200)
+
+ enable_opts=N
+ INTERNAL USE ONLY (MAY NOT WORK OR LEAD TO CRASHES): optimizations to
+ enable, or all =
+ intbounds:rewrite:virtualize:string:pure:earlyforce:heap:unroll (default
+ all)
+
+ function_threshold=N
+ number of times a function must run for it to become traced from start
+ (default 1619)
+
+ inlining=N
+ inline python functions or not (1/0) (default 1)
+
+ loop_longevity=N
+ a parameter controlling how long loops will be kept before being freed,
+ an estimate (default 1000)
+
+ max_retrace_guards=N
+ number of extra guards a retrace can cause (default 15)
+
+ max_unroll_loops=N
+ number of extra unrollings a loop can cause (default 0)
+
+ max_unroll_recursion=N
+ how many levels deep to unroll a recursive function (default 7)
+
+ retrace_limit=N
+ how many times we can try retracing before giving up (default 0)
+
+ threshold=N
+ number of times a loop has to run for it to become hot (default 1039)
+
+ trace_eagerness=N
+ number of times a guard has to fail before we start compiling a bridge
+ (default 200)
+
+ trace_limit=N
+ number of recorded operations before we abort tracing with ABORT_TOO_LONG
+ (default 6000)
+
+ vec=N
+ turn on the vectorization optimization (vecopt). Supports x86 (SSE 4.1),
+ powerpc (SVX), s390x SIMD (default 0)
+
+ vec_all=N
+ try to vectorize trace loops that occur outside of the numpypy library
+ (default 0)
+
+ vec_cost=N
+ threshold for which traces to bail. Unpacking increases the counter,
+ vector operation decrease the cost (default 0)
+
+ off
+ turn off the JIT
+ help
+ print this page
+
+The :ref:`pypyjit<jit-hooks>` module can be used to control the JIT from inside
+pypy
+
diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst
--- a/pypy/doc/release-v7.2.0.rst
+++ b/pypy/doc/release-v7.2.0.rst
@@ -216,6 +216,7 @@
* Add more constants to `sysconfig``. Set ``MACOSX_DEPLOYMENT_TARGET`` for
darwin (`issue 2994`_)
* fix ``CBuffer.buffer_attach``
+* Add ``_PyDict_GetItemWithError`` (``PyDict_GetItemWithError`` on Python3)
Python 3.6 only
---------------
@@ -307,6 +308,7 @@
.. _33786 : https://bugs.python.org/issue33786
.. _32270 : https://bugs.python.org/issue32270
.. _28691 : https://bugs.python.org/issue28691
+.. _33729 : https://bugs.python.org/issue33729
.. _opencv2: https://github.com/skvark/opencv-python/
.. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -3,11 +3,31 @@
==========================
.. this is a revision shortly after release-pypy-7.2.0
-.. startrev: 78cd4acbcbec
+.. startrev: a511d86377d6
+.. branch: fix-descrmismatch-crash
-.. branch: json-decoder-maps
+Fix segfault when calling descr-methods with no arguments
-Much faster and more memory-efficient JSON decoding. The resulting
-dictionaries that come out of the JSON decoder have faster lookups too.
+.. branch: https-readme
+Convert http -> https in README.rst
+
+.. branch: license-update
+
+Update list directories in LICENSE
+
+.. branch: allow-forcing-no-embed
+
+When packaging, allow suppressing embedded dependencies via
+PYPY_NO_EMBED_DEPENDENCIES
+
+.. branch: int-test-is-zero
+
+.. branch: cppyy-dev
+
+Upgraded the built-in ``_cppyy`` module to ``cppyy-backend 1.10.6``, which
+provides, among others, better template resolution, stricter ``enum`` handling,
+anonymous struct/unions, cmake fragments for distribution, optimizations for
+PODs, and faster wrapper calls.
+
diff --git a/pypy/doc/whatsnew-pypy2-5.7.0.rst
b/pypy/doc/whatsnew-pypy2-5.7.0.rst
--- a/pypy/doc/whatsnew-pypy2-5.7.0.rst
+++ b/pypy/doc/whatsnew-pypy2-5.7.0.rst
@@ -14,6 +14,7 @@
changed in exactly the same way because of this fix.
+
.. branch: rpython-error-to-systemerror
Any uncaught RPython exception (from a PyPy bug) is turned into an
diff --git a/pypy/doc/whatsnew-pypy2-7.2.0.rst
b/pypy/doc/whatsnew-pypy2-7.2.0.rst
--- a/pypy/doc/whatsnew-pypy2-7.2.0.rst
+++ b/pypy/doc/whatsnew-pypy2-7.2.0.rst
@@ -74,3 +74,9 @@
.. branch: openssl-for-macos
Update _ssl on macos to statically link to openssl-1.1.1c
+
+.. branch: json-decoder-maps
+
+Much faster and more memory-efficient JSON decoding. The resulting
+dictionaries that come out of the JSON decoder have faster lookups too.
+
diff --git a/pypy/doc/whatsnew-pypy3-2.3.1.rst
b/pypy/doc/whatsnew-pypy3-2.3.1.rst
deleted file mode 100644
--- a/pypy/doc/whatsnew-pypy3-2.3.1.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-=========================
-What's new in PyPy3 2.3.1
-=========================
-
-.. this is a revision shortly after pypy3-release-2.3.x
-.. startrev: 0137d8e6657d
diff --git a/pypy/doc/whatsnew-pypy3-2.4.0.rst
b/pypy/doc/whatsnew-pypy3-2.4.0.rst
deleted file mode 100644
--- a/pypy/doc/whatsnew-pypy3-2.4.0.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-=========================
-What's new in PyPy3 2.4.0
-=========================
-
-.. this is a revision shortly after pypy3-release-2.4.x
-.. startrev: 12b940544622
diff --git a/pypy/doc/whatsnew-pypy3-5.10.0.rst
b/pypy/doc/whatsnew-pypy3-5.10.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-5.10.0.rst
@@ -0,0 +1,7 @@
+========================
+What's new in PyPy3 7.0+
+========================
+
+.. this is the revision after release-pypy3.5-v7.0
+.. startrev: 9d2fa7c63b7c
+
diff --git a/pypy/doc/whatsnew-pypy3-6.0.0.rst
b/pypy/doc/whatsnew-pypy3-6.0.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-6.0.0.rst
@@ -0,0 +1,7 @@
+========================
+What's new in PyPy3 7.0+
+========================
+
+.. this is the revision after release-pypy3.5-v7.0
+.. startrev: 9d2fa7c63b7c
+
diff --git a/pypy/doc/whatsnew-pypy3-7.1.0.rst
b/pypy/doc/whatsnew-pypy3-7.1.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-7.1.0.rst
@@ -0,0 +1,11 @@
+========================
+What's new in PyPy3 7.0+
+========================
+
+.. this is the revision after release-pypy3.6-v7.0
+.. startrev: 33fe3b2cf186
+
+.. branch: py3.5
+
+Merge in py.35 and use this branch as the primary pypy3 one
+
diff --git a/pypy/doc/whatsnew-pypy3-7.2.0.rst
b/pypy/doc/whatsnew-pypy3-7.2.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/whatsnew-pypy3-7.2.0.rst
@@ -0,0 +1,58 @@
+=========================
+What's new in PyPy3 7.2.0
+=========================
+
+.. this is the revision after release-pypy3.6-v7.1.1
+.. startrev: db5a1e7fbbd0
+
+.. branch: fix-literal-prev_digit-underscore
+
+Fix parsing for converting strings with underscore into ints
+
+.. branch: winmultiprocessing
+
+Improve multiprocessing support on win32
+
+.. branch: setitem2d
+
+Allow 2d indexing in ``memoryview.__setitem__`` (issue bb-3028)
+
+.. branch: py3.6-socket-fix
+.. branch: fix-importerror
+.. branch: dj_s390
+.. branch: bpo-35409
+.. branch: remove_array_with_char_test
+.. branch: fix_test_unicode_outofrange
+.. branch: Ram-Rachum/faulthandleris_enabled-should-return-fal-1563636614875
+.. branch:
Anthony-Sottile/fix-leak-of-file-descriptor-with-_iofile-1559687440863
+
+.. branch: py3tests
+
+Add handling of application-level test files and -D flag to test runner
+
+.. branch: vendor/stdlib-3.6
+.. branch: stdlib-3.6.9
+
+Update standard library to version 3.6.9
+
+.. branch: __debug__-optimize
+
+Fix handling of __debug__, sys.flags.optimize, and '-O' command-line flag to
+match CPython 3.6.
+
+.. branch: more-cpyext
+
+Add ``PyErr_SetFromWindowsErr`` and ``pytime.h``, ``pytime.c``. Fix order of
+fields in ``Py_buffer``.
+
+.. branch: Ryan-Hileman/add-support-for-zipfile-stdlib-1562420744699
+
+Add support for the entire stdlib being inside a zipfile
+
+
+.. branch: json-decoder-maps-py3.6
+
+Much faster and more memory-efficient JSON decoding. The resulting
+dictionaries that come out of the JSON decoder have faster lookups too.
+
+
diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst
--- a/pypy/doc/whatsnew-pypy3-head.rst
+++ b/pypy/doc/whatsnew-pypy3-head.rst
@@ -1,7 +1,7 @@
-========================
-What's new in PyPy3 7.0+
-========================
-
-.. this is the revision after release-pypy3.5-v7.0
-.. startrev: 9d2fa7c63b7c
-
+========================
+What's new in PyPy3 7.2+
+========================
+
+.. this is the revision after release-pypy3.6-v7.2
+.. startrev: 6d2f8470165b
+
diff --git a/pypy/interpreter/astcompiler/test/apptest_misc.py
b/pypy/interpreter/astcompiler/test/apptest_misc.py
new file mode 100644
--- /dev/null
+++ b/pypy/interpreter/astcompiler/test/apptest_misc.py
@@ -0,0 +1,18 @@
+def test_warning_to_error_translation():
+ import warnings
+ statement = """\
+def wrong1():
+ a = 1
+ b = 2
+ global a
+ global b
+"""
+ with warnings.catch_warnings():
+ warnings.filterwarnings("error", module="<test string>")
+ try:
+ compile(statement, '<test string>', 'exec')
+ except SyntaxError as err:
+ assert err.lineno is not None
+ assert err.filename is not None
+ assert err.offset is not None
+ assert err.message is not None
diff --git a/pypy/interpreter/astcompiler/test/test_misc.py
b/pypy/interpreter/astcompiler/test/test_misc.py
--- a/pypy/interpreter/astcompiler/test/test_misc.py
+++ b/pypy/interpreter/astcompiler/test/test_misc.py
@@ -12,23 +12,3 @@
assert mangle("__foo", "__Bar") == "_Bar__foo"
assert mangle("__foo", "___") == "__foo"
assert mangle("___foo", "__Bar") == "_Bar___foo"
-
-def app_test_warning_to_error_translation():
- import warnings
-
- with warnings.catch_warnings():
- warnings.filterwarnings("error", module="<test string>")
- statement = """\
-def wrong1():
- a = 1
- b = 2
- global a
- global b
-"""
- try:
- compile(statement, '<test string>', 'exec')
- except SyntaxError as err:
- assert err.lineno is not None
- assert err.filename is not None
- assert err.offset is not None
- assert err.message is not None
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit