Skip to content

Commit

Permalink
#1040: just use Py_BuildValue on both py 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 3, 2017
1 parent 443763f commit e47981f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -3035,11 +3035,7 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) {
}
*--ptr = '\0';

#if PY_MAJOR_VERSION >= 3
py_mac_address = PyUnicode_FromString(buff);
#else
py_mac_address = PyString_FromString(buff);
#endif
py_mac_address = Py_BuildValue("s", buff);
if (py_mac_address == NULL)
goto error;

Expand Down

0 comments on commit e47981f

Please sign in to comment.