VirtualBox

Ignore:
Timestamp:
Aug 10, 2021 12:49:53 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146206
Message:

ValKit: More Python 3.9 API changes needed (array.array.tostring() -> .tobytes()) bugref:10079

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/reporter.py

    r84921 r90595  
    12231223            if isinstance(sText, array.array):
    12241224                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();
    12261230                except:
    12271231                    pass;
     
    12831287        if not utils.isString(sText):
    12841288            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;
    12871297            if hasattr(sText, 'decode'):
    12881298                try:    sText = sText.decode('utf-8', 'ignore');
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette