Changeset 70660 in vbox for trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py
- Timestamp:
- Jan 21, 2018 4:18:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py
r69111 r70660 12 12 13 13 """ 14 15 from __future__ import print_function; 14 16 15 17 __copyright__ = \ … … 41 43 import os; 42 44 import hashlib; 43 import StringIO; 44 from optparse import OptionParser; 45 from PIL import Image; # pylint: disable=import-error 45 if sys.version_info[0] >= 3: 46 from io import StringIO as StringIO; # pylint: disable=import-error,no-name-in-module 47 else: 48 from StringIO import StringIO as StringIO; # pylint: disable=import-error,no-name-in-module 49 from optparse import OptionParser; # pylint: disable=deprecated-module 50 from PIL import Image; # pylint: disable=import-error 46 51 47 52 # Add Test Manager's modules path … … 60 65 from testmanager.core.testresultfailures import TestResultFailureLogic, TestResultFailureData; 61 66 from testmanager.core.useraccount import UserAccountLogic; 67 68 # Python 3 hacks: 69 if sys.version_info[0] >= 3: 70 xrange = range; # pylint: disable=redefined-builtin,invalid-name 62 71 63 72 … … 224 233 else: 225 234 try: 226 oImage = Image.open(StringIO .StringIO(abImageFile));235 oImage = Image.open(StringIO(abImageFile)); 227 236 except Exception as oXcpt: 228 237 self.oSheriff.vprint(u'Error opening the "%s" image bytes using PIL.Image.open: %s' % (oFile.sFile, oXcpt,)) … … 302 311 Returns 1 (for exit code usage.) 303 312 """ 304 print 'error: %s' % (sText,);313 print('error: %s' % (sText,)); 305 314 if self.oLogFile is not None: 306 315 self.oLogFile.write((u'error: %s\n' % (sText,)).encode('utf-8')); … … 313 322 if self.oConfig.fDebug: 314 323 if not self.oConfig.fQuiet: 315 print 'debug: %s' % (sText,);324 print('debug: %s' % (sText, )); 316 325 if self.oLogFile is not None: 317 326 self.oLogFile.write((u'debug: %s\n' % (sText,)).encode('utf-8')); … … 323 332 """ 324 333 if not self.oConfig.fQuiet: 325 print 'info: %s' % (sText,);334 print('info: %s' % (sText,)); 326 335 if self.oLogFile is not None: 327 336 self.oLogFile.write((u'info: %s\n' % (sText,)).encode('utf-8'));
Note:
See TracChangeset
for help on using the changeset viewer.