File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818class 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
You can’t perform that action at this time.
0 commit comments