diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-12-06 21:52:10 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-12-06 21:52:10 +0000 |
commit | 3424ff1f5eb9093329c7265f46892d6cd4d4ac34 (patch) | |
tree | 45764f1674c5597763b950f2a0019223aacf94d7 /gpspacket.c | |
parent | ccf852bd922a501e0282b8cc5183580ef6b0c47d (diff) | |
download | gpsd-3424ff1f5eb9093329c7265f46892d6cd4d4ac34.tar.gz |
Followed some advice from Andreas Stricker.
Diffstat (limited to 'gpspacket.c')
-rw-r--r-- | gpspacket.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/gpspacket.c b/gpspacket.c index b5cfc9a2..6857b348 100644 --- a/gpspacket.c +++ b/gpspacket.c @@ -18,8 +18,6 @@ void gpsd_report(int errlevel UNUSED, const char *fmt, ... ) va_end(ap); } -static PyObject *ErrorObject; - typedef struct { PyObject_HEAD struct gps_packet_t getter; @@ -56,7 +54,7 @@ Getter_get(GetterObject *self, PyObject *args) int fd; ssize_t type; - if (!PyArg_ParseTuple(args, "i:get", &fd)) + if (!PyArg_ParseTuple(args, "i;missing or invalid file descriptor argument to gpspacket.get", &fd)) return NULL; type = packet_get(fd, &self->getter); @@ -174,24 +172,12 @@ initgpspacket(void) { PyObject *m; - /* Finalize the type object including setting type of the new type - * object; doing it here is required for portability to Windows - * without requiring C++. */ if (PyType_Ready(&Getter_Type) < 0) return; /* Create the module and add the functions */ m = Py_InitModule3("gpspacket", gpspacket_methods, module_doc); - /* Add some symbolic constants to the module */ - if (ErrorObject == NULL) { - ErrorObject = PyErr_NewException("gpspacket.error", NULL, NULL); - if (ErrorObject == NULL) - return; - } - Py_INCREF(ErrorObject); - PyModule_AddObject(m, "error", ErrorObject); - PyModule_AddIntConstant(m, "BAD_PACKET", BAD_PACKET); PyModule_AddIntConstant(m, "COMMENT_PACKET", COMMENT_PACKET); PyModule_AddIntConstant(m, "NMEA_PACKET", NMEA_PACKET); |