summaryrefslogtreecommitdiff
path: root/usr/src/lib/pylibbe/common
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-01-16 12:19:33 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-01-16 12:19:33 +0000
commitd3f83376d2ed784ca0a6ba3d8cd1fdaee338f1c4 (patch)
treef5da272fde15217209aa45ff8a07779656164933 /usr/src/lib/pylibbe/common
parentf634d1677b30daf0327321f2f1f01ea3686f422c (diff)
parent6554ec17858060401cf0f52e78b57fec69f7842d (diff)
downloadillumos-joyent-release-20200116.tar.gz
[illumos-gate merge]release-20200116
commit 6554ec17858060401cf0f52e78b57fec69f7842d 12195 acpidump failed under EFI commit 00f7aa5b4350768e529a41a31488f44902224fcf 12186 The n2rng man page incorrectly refers to n2cp commit 005be40cf09c8b0bcf2de631893dae837ff4cb8a 12188 libfmd_adm: Wrong prerequisites for generated files commit b0858fdc3790ef1d1f955bd584621c6fd539050d 11522 illumos-gate has some runtime dependencies on Python 2.7 12192 python3 modules treat strings incorrectly
Diffstat (limited to 'usr/src/lib/pylibbe/common')
-rw-r--r--usr/src/lib/pylibbe/common/libbe_py.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/src/lib/pylibbe/common/libbe_py.c b/usr/src/lib/pylibbe/common/libbe_py.c
index 6e35228128..6402e0daad 100644
--- a/usr/src/lib/pylibbe/common/libbe_py.c
+++ b/usr/src/lib/pylibbe/common/libbe_py.c
@@ -202,9 +202,15 @@ beCopy(PyObject *self, PyObject *args)
NULL, NULL));
}
while (PyDict_Next(beNameProperties, &pos, &pkey, &pvalue)) {
+#if PY_MAJOR_VERSION >= 3
+ if (!convertPyArgsToNvlist(&beProps, 2,
+ PyUnicode_AsUTF8(pkey),
+ PyUnicode_AsUTF8(pvalue))) {
+#else
if (!convertPyArgsToNvlist(&beProps, 2,
- PyBytes_AS_STRING(pkey),
- PyBytes_AS_STRING(pvalue))) {
+ PyString_AsString(pkey),
+ PyString_AsString(pvalue))) {
+#endif
nvlist_free(beProps);
nvlist_free(beAttrs);
return (Py_BuildValue("[iss]", BE_PY_ERR_NVLIST,