Changeset 90595 in vbox
- Timestamp:
- Aug 10, 2021 12:49:53 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146206
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/reporter.py
r84921 r90595 1223 1223 if isinstance(sText, array.array): 1224 1224 try: 1225 sText = sText.tostring(); 1225 if sys.version_info < (3, 9, 0): 1226 # Removed since Python 3.9. 1227 sText.tostring(); # pylint: disable=no-member 1228 else: 1229 sText.tobytes(); 1226 1230 except: 1227 1231 pass; … … 1283 1287 if not utils.isString(sText): 1284 1288 if isinstance(sText, array.array): 1285 try: sText = sText.tostring(); 1286 except: pass; 1289 try: 1290 if sys.version_info < (3, 9, 0): 1291 # Removed since Python 3.9. 1292 sText = sText.tostring(); # pylint: disable=no-member 1293 else: 1294 sText = sText.tobytes(); 1295 except: 1296 pass; 1287 1297 if hasattr(sText, 'decode'): 1288 1298 try: sText = sText.decode('utf-8', 'ignore'); -
trunk/src/VBox/ValidationKit/testdriver/txsclient.py
r90594 r90595 307 307 cbMsg = getU32(abHdr, 0); 308 308 uCrc32 = getU32(abHdr, 4); 309 sOpcode = abHdr[8:16].tostring().decode('ascii'); 309 310 if sys.version_info < (3, 9, 0): 311 # Removed since Python 3.9. 312 sOpcode = abHdr[8:16].tostring(); # pylint: disable=no-member 313 else: 314 sOpcode = abHdr[8:16].tobytes(); 315 sOpcode = sOpcode.decode('ascii'); 310 316 311 317 if cbMsg < 16: … … 1270 1276 # Finally, push the data to the file. 1271 1277 try: 1272 oLocalFile.write(abPayload[4:].tostring()); 1278 if sys.version_info < (3, 9, 0): 1279 # Removed since Python 3.9. 1280 abData = abPayload[4:].tostring(); 1281 else: 1282 abData = abPayload[4:].tobytes(); 1283 oLocalFile.write(abData); 1273 1284 except: 1274 1285 reporter.errorXcpt('I/O error writing to "%s"' % (sRemoteFile)); -
trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py
r86891 r90595 272 272 try: 273 273 oHash = hashlib.sha256(); 274 oHash.update(oImage.tostring()); 274 if sys.version_info < (3, 9, 0): 275 # Removed since Python 3.9. 276 oHash.update(oImage.tostring()); # pylint: disable=no-member 277 else: 278 oHash.update(oImage.tobytes()); 275 279 except Exception as oXcpt: 276 280 self.oSheriff.vprint(u'Error hashing the uncompressed image bytes for "%s": %s' % (oFile.sFile, oXcpt,)) … … 1753 1757 if __name__ == '__main__': 1754 1758 sys.exit(VirtualTestSheriff().main()); 1755 -
trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py
r82968 r90595 64 64 if isinstance(sText, array.array): 65 65 try: 66 return str(sText.tostring()); # tostring() returns bytes with python3. 66 if sys.version_info < (3, 9, 0): 67 # Removed since Python 3.9. 68 return str(sText.tostring()); # pylint: disable=no-member 69 else: 70 return str(sText.tobytes()); 67 71 except: 68 72 pass; … … 301 305 302 306 return fRc; 303
Note:
See TracChangeset
for help on using the changeset viewer.