Skip to content

Commit 739d3ec

Browse files
committed
Use unicode string in Python3, avoid compiler warning
1 parent c660631 commit 739d3ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/_jsonnet.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ PyMODINIT_FUNC PyInit__jsonnet(void)
667667
{
668668
PyObject *module = PyModule_Create(&_module);
669669
PyObject *version_str = PyUnicode_FromString(LIB_JSONNET_VERSION);
670-
PyModule_AddObjectRef(module, "version", version_str);
670+
if (PyModule_AddObject(module, "version", PyUnicode_FromString(LIB_JSONNET_VERSION)) < 0) {
671+
Py_XDECREF(version_str);
672+
}
671673
return module;
672674
}
673675
#else

0 commit comments

Comments
 (0)