py3
This commit is contained in:
@ -269,7 +269,11 @@ static struct PyModuleDef dbapimodule = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
PyMODINIT_FUNC PyInit__dbapi(void)
|
||||
#else
|
||||
PyMODINIT_FUNC init_dbapi(void)
|
||||
#endif
|
||||
{
|
||||
PyObject *mod = NULL, *hookdict, *vertup;
|
||||
pystate *st;
|
||||
|
@ -52,7 +52,7 @@ device(mbboDirect, INST_IO, pydevsupComOut, "Python Device")
|
||||
device(waveform, INST_IO, pydevsupComIn, "Python Device")
|
||||
device(aai, INST_IO, pydevsupComIn, "Python Device")
|
||||
device(aao, INST_IO, pydevsupComOut, "Python Device")
|
||||
""")
|
||||
""".encode('ascii'))
|
||||
F.flush()
|
||||
_dbapi.dbReadDatabase(F.name)
|
||||
_dbapi._dbd_setup()
|
||||
|
@ -23,7 +23,7 @@ class IOCHelper(unittest.TestCase):
|
||||
|
||||
if self.db is not None:
|
||||
with tempfile.NamedTemporaryFile() as F:
|
||||
F.write(self.db)
|
||||
F.write(self.db.encode('ascii'))
|
||||
F.flush()
|
||||
_dbapi.dbReadDatabase(F.name)
|
||||
|
||||
@ -159,7 +159,8 @@ class TestField(IOCHelper):
|
||||
|
||||
rec.VAL = ["zero", "", "one", "This is a really long string which should be truncated", "", "last"]
|
||||
|
||||
assert_array_equal(rec.VAL, ["zero", "", "one", "This is a really long string which shoul", "", "last"])
|
||||
assert_array_equal(rec.VAL,
|
||||
numpy.asarray(["zero", "", "one", "This is a really long string which shoul", "", "last"], dtype='S40'))
|
||||
|
||||
|
||||
class TestDset(IOCHelper):
|
||||
|
Reference in New Issue
Block a user