| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,11 +103,17 @@ cdef void PyToCefString( | |||
| 103 | 103 | CefString& cefString | |
| 104 | 104 | ) except *: | |
| 105 | 105 | 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) | ||
| 106 | 109 | if type(pyString) == unicode: | |
| 107 | 110 | pyString = <bytes>(pyString.encode( | |
| 108 | 111 | g_applicationSettings["string_encoding"], | |
| 109 | 112 | errors=UNICODE_ENCODE_ERRORS)) | |
| 110 | 113 | 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) | ||
| 111 | 117 | # The unicode type is not defined in Python 3. | |
| 112 | 118 | if type(pyString) == str: | |
| 113 | 119 | pyString = <bytes>(pyString.encode( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments