VirtualBox

Changeset 59824 in vbox for trunk


Ignore:
Timestamp:
Feb 25, 2016 7:12:28 PM (9 years ago)
Author:
vboxsync
Message:

python/server/policy.py: fix syntax incompatibility between python3 and python2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/server/policy.py

    r59801 r59824  
    294294            if logger.isEnabledFor(logging.DEBUG):
    295295                try:
    296                     raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
     296                    if sys.version_info[0] <= 2:
     297                        exec('raise exc_info[0], exc_info[1], exc_info[2]')
     298                    else:
     299                        raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
    297300                except:
    298301                    logger.debug("'%s' raised COM Exception %s",
     
    302305        # As above, trick the logging module to handle Python 2.3
    303306        try:
    304             raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
     307            if sys.version_info[0] <= 2:
     308                exec('raise exc_info[0], exc_info[1], exc_info[2]')
     309            else:
     310                raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
    305311        except:
    306312            logger.exception("Unhandled exception calling '%s'", func_name)
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