Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 4466b54

Browse files
committed
Use GeoIP_country_name under Python 2.x
1 parent 77ee667 commit 4466b54

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

py_GeoIP.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,11 @@ GeoIP_populate_module(PyObject *m)
789789
CHECK_NULL(tmp = PyUnicode_FromString(GeoIP_country_code[i]));
790790
PyTuple_SET_ITEM(ccode, i, tmp);
791791

792+
#if PY_MAJOR_VERSION >= 3
792793
CHECK_NULL(tmp = PyUnicode_FromString(GeoIP_utf8_country_name[i]));
794+
#else
795+
CHECK_NULL(tmp = PyUnicode_FromString(GeoIP_country_name[i]));
796+
#endif
793797
CHECK(PyDict_SetItemString(cname, GeoIP_country_code[i], tmp));
794798
Py_DECREF(tmp);
795799

0 commit comments

Comments
 (0)