Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95669:83df732f6df1
Date: 2019-01-18 13:31 +0200
http://bitbucket.org/pypy/pypy/changeset/83df732f6df1/
Log: merge unicode-utf8 into branch
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -15,11 +15,15 @@
rsyncignore = ['_cache']
try:
- from hypothesis import settings
+ from hypothesis import settings, __version__
except ImportError:
pass
else:
- settings.register_profile('default', deadline=None)
+ if __version__[:2] < '3.6':
+ s = settings(deadline=None)
+ settings.register_profile('default', s)
+ else:
+ settings.register_profile('default', deadline=None)
settings.load_profile('default')
# PyPy's command line extra options (these are added
diff --git a/pypy/module/_sre/test/test_app_sre.py
b/pypy/module/_sre/test/test_app_sre.py
--- a/pypy/module/_sre/test/test_app_sre.py
+++ b/pypy/module/_sre/test/test_app_sre.py
@@ -123,6 +123,11 @@
import re, _weakref
_weakref.ref(re.compile(r""))
+ def test_match_compat(self):
+ import re
+ res = re.match(r'(a)|(b)', 'b').start(1)
+ assert res == -1
+
def test_pattern_check(self):
import _sre
raises(TypeError, _sre.compile, {}, 0, [])
diff --git a/rpython/conftest.py b/rpython/conftest.py
--- a/rpython/conftest.py
+++ b/rpython/conftest.py
@@ -5,6 +5,18 @@
option = None
+try:
+ from hypothesis import settings, __version__
+except ImportError:
+ pass
+else:
+ if __version__[:2] < '3.6':
+ s = settings(deadline=None)
+ settings.register_profile('default', s)
+ else:
+ settings.register_profile('default', deadline=None)
+ settings.load_profile('default')
+
def braindead_deindent(self):
"""monkeypatch that wont end up doing stupid in the python tokenizer"""
text = '\n'.join(self.lines)
diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py
--- a/rpython/rlib/rutf8.py
+++ b/rpython/rlib/rutf8.py
@@ -572,6 +572,8 @@
logarithmic in the length of the string, plus some constant that
is not tiny either.
"""
+ if bytepos < 0:
+ return bytepos
index_min = 0
index_max = len(storage) - 1
while index_min < index_max:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit