File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,17 @@ cdef void PyToCefString(
103103 CefString& cefString
104104 ) except * :
105105 if PY_MAJOR_VERSION < 3 :
106+ # Handle objects that may be converted to string e.g. QString
107+ if not isinstance (pyString, str ) and not isinstance (pyString, unicode ):
108+ pyString = str (pyString)
106109 if type (pyString) == unicode :
107110 pyString = < bytes> (pyString.encode(
108111 g_applicationSettings[" string_encoding" ],
109112 errors = UNICODE_ENCODE_ERRORS))
110113 else :
114+ # Handle objects that may be converted to string e.g. QString
115+ if not isinstance (pyString, str ) and not isinstance (pyString, bytes):
116+ pyString = str (pyString)
111117 # The unicode type is not defined in Python 3.
112118 if type (pyString) == str :
113119 pyString = < bytes> (pyString.encode(
You can’t perform that action at this time.
0 commit comments