Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39e360b

Browse files
committed
fix failing test from rename
1 parent 3d1e861 commit 39e360b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/ctypes/test/test_python_api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717

1818
class PythonAPITestCase(unittest.TestCase):
1919

20-
def test_PyString_FromStringAndSize(self):
21-
PyString_FromStringAndSize = pythonapi.PyString_FromStringAndSize
20+
def test_PyBytes_FromStringAndSize(self):
21+
PyBytes_FromStringAndSize = pythonapi.PyBytes_FromStringAndSize
2222

23-
PyString_FromStringAndSize.restype = py_object
24-
PyString_FromStringAndSize.argtypes = c_char_p, c_py_ssize_t
23+
PyBytes_FromStringAndSize.restype = py_object
24+
PyBytes_FromStringAndSize.argtypes = c_char_p, c_py_ssize_t
2525

26-
self.failUnlessEqual(PyString_FromStringAndSize(b"abcdefghi", 3), b"abc")
26+
self.failUnlessEqual(PyBytes_FromStringAndSize(b"abcdefghi", 3), b"abc")
2727

2828
def test_PyString_FromString(self):
29-
pythonapi.PyString_FromString.restype = py_object
30-
pythonapi.PyString_FromString.argtypes = (c_char_p,)
29+
pythonapi.PyBytes_FromString.restype = py_object
30+
pythonapi.PyBytes_FromString.argtypes = (c_char_p,)
3131

3232
s = b"abc"
3333
refcnt = grc(s)
34-
pyob = pythonapi.PyString_FromString(s)
34+
pyob = pythonapi.PyBytes_FromString(s)
3535
self.failUnlessEqual(grc(s), refcnt)
3636
self.failUnlessEqual(s, pyob)
3737
del pyob

0 commit comments

Comments
 (0)