swig/Examples/test-suite/python/exception_classname_runme.py
Ben Webb 2a5bbb6018 Qualify use of "__builtin__.Exception" class.
It is possible that the module we're wrapping defines an Exception
class. This will confuse code that uses an unqualified "Exception"
class (e.g. "try: ... except Exception") since it now won't match
the Python builtin Exception. Fix this by explicitly using
the class from the __builtin__ module ("builtins" in Python 3).
2016-01-11 21:43:10 -08:00

4 lines
90 B
Python

import exception_classname
a = exception_classname.Exception()
assert a.testfunc() == 42