summaryrefslogtreecommitdiff
path: root/gi
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-01-19 13:43:28 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2019-01-19 13:43:28 +0100
commitb66e964ec1b27d5786d2e2276d18764df6a06e6c (patch)
tree1a4f802740e6694b68fbc949b6d34a273c1213e4 /gi
parent6c69fc7b582ec1fd3faef4de3fade9a0cb7f8c05 (diff)
downloadpygobject-b66e964ec1b27d5786d2e2276d18764df6a06e6c.tar.gz
Value.set_value: allow None for TYPE_STRING
set_string() allows it too
Diffstat (limited to 'gi')
-rw-r--r--gi/overrides/GObject.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gi/overrides/GObject.py b/gi/overrides/GObject.py
index 04b5be65..20a92b0e 100644
--- a/gi/overrides/GObject.py
+++ b/gi/overrides/GObject.py
@@ -258,8 +258,8 @@ class Value(GObjectModule.Value):
elif gtype == TYPE_DOUBLE:
self.set_double(py_value)
elif gtype == TYPE_STRING:
- if isinstance(py_value, str):
- py_value = str(py_value)
+ if py_value is None or isinstance(py_value, str):
+ py_value = py_value
elif PY2:
if isinstance(py_value, text_type):
py_value = py_value.encode('UTF-8')