Changeset 82635 in vbox
- Timestamp:
- Dec 22, 2019 6:53:40 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135522
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r81112 r82635 63 63 xrange = range; # pylint: disable=redefined-builtin,invalid-name 64 64 long = int; # pylint: disable=redefined-builtin,invalid-name 65 66 67 # 68 # Strings. 69 # 70 71 def toUnicode(sString, encoding = None, errors = 'strict'): 72 """ 73 A little like the python 2 unicode() function. 74 """ 75 if sys.version_info[0] >= 3: 76 if isinstance(sString, bytes): 77 return str(sString, encoding if encoding else 'utf-8', errors); 78 else: 79 if not isinstance(sString, unicode): 80 return unicode(sString, encoding, errors); 81 return sString; 82 65 83 66 84
Note:
See TracChangeset
for help on using the changeset viewer.