Skip to content
Snippets Groups Projects
Commit ec28a1ae authored by Marco Biasini's avatar Marco Biasini
Browse files

fix geom unit tests for old version of Boost.Python

On some old versions of Boost.Python, std::out_of_range
is not properly converted to IndexError. Instead, a
RuntimeError is raised. For these versions, we overwrite
the IndexError type with the type of the exception
raised by geom.Vec2()[3].
parent 28ad9cd0
Branches
Tags
No related merge requests found
......@@ -26,6 +26,14 @@ if __name__== '__main__':
import ost
import ost.geom as geom
# this terrible hack is required for older version of Python/Boost
# which do not convert std::out_of_range to IndexError correctly.
try:
geom.Vec2()[3]
except Exception, e:
pass
IndexError = type(e)
class TestGeom(unittest.TestCase):
def runTest(self):
self.test_repr()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment