summaryrefslogtreecommitdiff
path: root/tests/run/bytearraymethods.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/bytearraymethods.pyx')
-rw-r--r--tests/run/bytearraymethods.pyx10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/bytearraymethods.pyx b/tests/run/bytearraymethods.pyx
index 76743a71f..bf0e0d633 100644
--- a/tests/run/bytearraymethods.pyx
+++ b/tests/run/bytearraymethods.pyx
@@ -287,3 +287,13 @@ cdef class BytearraySubtype(bytearray):
"""
def _append(self, x):
self.append(x)
+
+def fromhex(bytearray b):
+ """
+ https://github.com/cython/cython/issues/5051
+ Optimization of bound method calls was breaking classmethods
+ >>> fromhex(bytearray(b""))
+ """
+ if IS_PY3:
+ assert b.fromhex('2Ef0 F1f2 ') == b'.\xf0\xf1\xf2'
+ # method doesn't exist on Py2!