py3
This commit is contained in:
@ -269,7 +269,11 @@ static struct PyModuleDef dbapimodule = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
PyMODINIT_FUNC PyInit__dbapi(void)
|
||||||
|
#else
|
||||||
PyMODINIT_FUNC init_dbapi(void)
|
PyMODINIT_FUNC init_dbapi(void)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
PyObject *mod = NULL, *hookdict, *vertup;
|
PyObject *mod = NULL, *hookdict, *vertup;
|
||||||
pystate *st;
|
pystate *st;
|
||||||
|
@ -52,7 +52,7 @@ device(mbboDirect, INST_IO, pydevsupComOut, "Python Device")
|
|||||||
device(waveform, INST_IO, pydevsupComIn, "Python Device")
|
device(waveform, INST_IO, pydevsupComIn, "Python Device")
|
||||||
device(aai, INST_IO, pydevsupComIn, "Python Device")
|
device(aai, INST_IO, pydevsupComIn, "Python Device")
|
||||||
device(aao, INST_IO, pydevsupComOut, "Python Device")
|
device(aao, INST_IO, pydevsupComOut, "Python Device")
|
||||||
""")
|
""".encode('ascii'))
|
||||||
F.flush()
|
F.flush()
|
||||||
_dbapi.dbReadDatabase(F.name)
|
_dbapi.dbReadDatabase(F.name)
|
||||||
_dbapi._dbd_setup()
|
_dbapi._dbd_setup()
|
||||||
|
@ -23,7 +23,7 @@ class IOCHelper(unittest.TestCase):
|
|||||||
|
|
||||||
if self.db is not None:
|
if self.db is not None:
|
||||||
with tempfile.NamedTemporaryFile() as F:
|
with tempfile.NamedTemporaryFile() as F:
|
||||||
F.write(self.db)
|
F.write(self.db.encode('ascii'))
|
||||||
F.flush()
|
F.flush()
|
||||||
_dbapi.dbReadDatabase(F.name)
|
_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"]
|
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):
|
class TestDset(IOCHelper):
|
||||||
|
Reference in New Issue
Block a user