@@ -150,7 +150,7 @@ static int strv_converter(PyObject* obj, void *_result) {
150150}
151151
152152static int long_as_fd (PyObject * obj , int * fd ) {
153- long num = long_AsLong (obj );
153+ long num = PyLong_AsLong (obj );
154154 if (PyErr_Occurred ())
155155 return -1 ;
156156
@@ -243,7 +243,7 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
243243 }
244244
245245 if (_path ) {
246- if (long_Check (_path )) {
246+ if (PyLong_Check (_path )) {
247247 int fd ;
248248
249249 if (long_as_fd (_path , & fd ) < 0 )
@@ -341,7 +341,7 @@ static PyObject* Reader_fileno(Reader *self, PyObject *args) {
341341 set_error (fd , NULL , NULL );
342342 if (fd < 0 )
343343 return NULL ;
344- return long_FromLong (fd );
344+ return PyLong_FromLong (fd );
345345}
346346
347347PyDoc_STRVAR (Reader_reliable_fd__doc__ ,
@@ -375,7 +375,7 @@ static PyObject* Reader_get_events(Reader *self, PyObject *args) {
375375 r = sd_journal_get_events (self -> journal );
376376 if (set_error (r , NULL , NULL ) < 0 )
377377 return NULL ;
378- return long_FromLong (r );
378+ return PyLong_FromLong (r );
379379}
380380
381381PyDoc_STRVAR (Reader_get_timeout__doc__ ,
@@ -547,7 +547,7 @@ static int extract(const char* msg, size_t msg_len,
547547 }
548548
549549 if (key ) {
550- k = unicode_FromStringAndSize (msg , delim_ptr - (const char * ) msg );
550+ k = PyUnicode_FromStringAndSize (msg , delim_ptr - (const char * ) msg );
551551 if (!k )
552552 return -1 ;
553553 }
@@ -957,7 +957,7 @@ static PyObject* Reader_process(Reader *self, PyObject *args) {
957957 if (set_error (r , NULL , NULL ) < 0 )
958958 return NULL ;
959959
960- return long_FromLong (r );
960+ return PyLong_FromLong (r );
961961}
962962
963963PyDoc_STRVAR (Reader_wait__doc__ ,
@@ -984,7 +984,7 @@ static PyObject* Reader_wait(Reader *self, PyObject *args) {
984984 if (set_error (r , NULL , NULL ) < 0 )
985985 return NULL ;
986986
987- return long_FromLong (r );
987+ return PyLong_FromLong (r );
988988}
989989
990990PyDoc_STRVAR (Reader_seek_cursor__doc__ ,
@@ -1022,7 +1022,7 @@ static PyObject* Reader_get_cursor(Reader *self, PyObject *args) {
10221022 if (set_error (r , NULL , NULL ) < 0 )
10231023 return NULL ;
10241024
1025- return unicode_FromString (cursor );
1025+ return PyUnicode_FromString (cursor );
10261026}
10271027
10281028PyDoc_STRVAR (Reader_test_cursor__doc__ ,
@@ -1073,7 +1073,7 @@ static PyObject* Reader_query_unique(Reader *self, PyObject *args) {
10731073 if (!value_set )
10741074 return NULL ;
10751075
1076- key = unicode_FromString (query );
1076+ key = PyUnicode_FromString (query );
10771077 if (!key )
10781078 return NULL ;
10791079
@@ -1232,7 +1232,7 @@ static PyObject* Reader_get_catalog(Reader *self, PyObject *args) {
12321232 if (set_error (r , NULL , NULL ) < 0 )
12331233 return NULL ;
12341234
1235- return unicode_FromString (msg );
1235+ return PyUnicode_FromString (msg );
12361236}
12371237
12381238PyDoc_STRVAR (get_catalog__doc__ ,
@@ -1261,7 +1261,7 @@ static PyObject* get_catalog(PyObject *self _unused_, PyObject *args) {
12611261 if (set_error (r , NULL , NULL ) < 0 )
12621262 return NULL ;
12631263
1264- return unicode_FromString (msg );
1264+ return PyUnicode_FromString (msg );
12651265}
12661266
12671267PyDoc_STRVAR (data_threshold__doc__ ,
@@ -1279,7 +1279,7 @@ static PyObject* Reader_get_data_threshold(Reader *self, void *closure _unused_)
12791279 if (set_error (r , NULL , NULL ) < 0 )
12801280 return NULL ;
12811281
1282- return long_FromSize_t (cvalue );
1282+ return PyLong_FromSize_t (cvalue );
12831283}
12841284
12851285static int Reader_set_data_threshold (Reader * self , PyObject * value , void * closure _unused_ ) {
@@ -1292,12 +1292,12 @@ static int Reader_set_data_threshold(Reader *self, PyObject *value, void *closur
12921292 return -1 ;
12931293 }
12941294
1295- if (!long_Check (value )){
1295+ if (!PyLong_Check (value )){
12961296 PyErr_SetString (PyExc_TypeError , "Data threshold must be an int" );
12971297 return -1 ;
12981298 }
12991299
1300- r = sd_journal_set_data_threshold (self -> journal , (size_t ) long_AsLong (value ));
1300+ r = sd_journal_set_data_threshold (self -> journal , (size_t ) PyLong_AsLong (value ));
13011301 return set_error (r , NULL , NULL );
13021302}
13031303
0 commit comments