VirtualBox

Ignore:
Timestamp:
Nov 25, 2020 2:45:30 PM (4 years ago)
Author:
vboxsync
Message:

ValKit: Shut up python3 compilation errors. bugref:9788

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/win/fix_stale_refs.py

    r82968 r86975  
    7676            try:
    7777                value = QueryValueEx(hkey_product_properties, 'DisplayName')[0]
    78             except WindowsError, exception:
    79                 if exception.winerror != 2:
     78            except WindowsError as oXcpt:
     79                if oXcpt.winerror != 2:
    8080                    raise
    8181                value = '<unknown>'
     
    8383            products[product_guid] = value
    8484            product_index += 1
    85     except WindowsError, exceptione:
    86         if exceptione.winerror != 259:
    87             print exceptione.strerror + '.', 'error', exceptione.winerror
     85    except WindowsError as oXcpt:
     86        if oXcpt.winerror != 259:
     87            print(oXcpt.strerror + '.', 'error', oXcpt.winerror)
    8888    CloseKey(hkey_products)
    8989
    90     print 'Installed products:'
     90    print('Installed products:')
    9191    for product_key in sorted(products.keys()):
    92         print transpose_guid(product_key), '=', products[product_key]
     92        print(transpose_guid(product_key), '=', products[product_key])
    9393
    94     print
     94    print()
    9595    return products
    9696
     
    127127    missing_products = get_missing_products(hkey_components)
    128128
    129     print 'Missing products refer the following components:'
     129    print('Missing products refer the following components:')
    130130    for product_guid in sorted(missing_products.keys()):
    131131        if product_guid[1:] == '0'*31:
    132132            continue
    133         print 'Product', transpose_guid(product_guid) + ':'
     133        print('Product', transpose_guid(product_guid) + ':')
    134134        for component_guid, component_file in missing_products[product_guid]:
    135             print ' ' + transpose_guid(component_guid), '=', component_file
     135            print(' ' + transpose_guid(component_guid), '=', component_file)
    136136
    137         print 'Remove all references to product', transpose_guid(product_guid) + '? [y/n]'
     137        print('Remove all references to product', transpose_guid(product_guid) + '? [y/n]')
    138138        if strtobool(raw_input().lower()):
    139139            for component_guid, component_file in missing_products[product_guid]:
    140140                hkey_component = OpenKey(hkey_components, component_guid, 0, KEY_ALL_ACCESS)
    141                 print 'Removing reference in ' + transpose_guid(component_guid), '=', component_file
     141                print('Removing reference in ' + transpose_guid(component_guid), '=', component_file)
    142142                DeleteValue(hkey_component, product_guid)
    143143                CloseKey(hkey_component)
    144144        else:
    145             print 'Cancelled removal of product', transpose_guid(product_guid)
     145            print('Cancelled removal of product', transpose_guid(product_guid))
    146146
    147147    CloseKey(hkey_components)
Note: See TracChangeset for help on using the changeset viewer.

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