Skip to content

Commit d6b4f03

Browse files
committed
fix tostring deprecation
1 parent 9a4b949 commit d6b4f03

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎test/test_stringarr.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def setUp(self):
4141
v2[:-1] = data[:-1]
4242
v2[-1] = data[-1]
4343
v2[-1,-1] = data[-1,-1] # write single element
44-
v2[-1,-1] = data[-1,-1].tostring() # write single python string
44+
v2[-1,-1] = data[-1,-1].tobytes() # write single python string
4545
# _Encoding should be ignored if an array of characters is specified
4646
v3[:] = stringtochar(data, encoding='ascii')
4747
nc.close()

‎test/test_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def runTest(self):
6868
#assert np.allclose(datarr, ranarr[1:n1dim].astype(data.dtype))
6969
assert_array_almost_equal(datarr,ranarr[1:n1dim].astype(data.dtype))
7070
else:
71-
assert datarr.tostring() == ranarr[1:n1dim].astype(data.dtype).tostring()
71+
assert datarr.tobytes() == ranarr[1:n1dim].astype(data.dtype).tobytes()
7272
# check that variable elements not yet written are filled
7373
# with the specified _FillValue.
7474
assert_array_equal(datfilled,np.asarray(data._FillValue,datfilled.dtype))

0 commit comments

Comments
 (0)