summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2020-06-14 14:46:02 +0900
committerGitHub <noreply@github.com>2020-06-14 14:46:02 +0900
commitd708e4c08e6603614001d9ac807e7bae693bb69c (patch)
treead0412890c40abbe2cb66adc73b6a6dde276ba74
parent930b9813f5ffed736a63a2ffaf9a696d120de888 (diff)
downloadnetifaces-git-d708e4c08e6603614001d9ac807e7bae693bb69c.tar.gz
Replace PyUnicode_FromUnicode
PyUnicode_FromUnicode is deprecated since Python 3.3. Replace it with PyUnicode_FromWideChar.
-rw-r--r--netifaces.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/netifaces.c b/netifaces.c
index fefbf9d..49c7bc3 100644
--- a/netifaces.c
+++ b/netifaces.c
@@ -1567,7 +1567,7 @@ gateways (PyObject *self)
break;
}
- ifname = PyUnicode_FromUnicode (pwcsName, wcslen (pwcsName));
+ ifname = PyUnicode_FromWideChar (pwcsName, -1);
isdefault = bBest ? Py_True : Py_False;
tuple = PyTuple_Pack (3, gateway, ifname, isdefault);
@@ -1674,7 +1674,7 @@ gateways (PyObject *self)
if (bBest)
dwBestMetric = table->table[n].dwForwardMetric1;
- ifname = PyUnicode_FromUnicode (pwcsName, wcslen (pwcsName));
+ ifname = PyUnicode_FromWideChar (pwcsName, -1);
gateway = PyUnicode_FromString (gwbuf);
isdefault = bBest ? Py_True : Py_False;