App: do not hide actual exception type in DocumentObjectPy::addProperty/DocumentObjectPy::removeProperty

and throw TypeError in DynamicProperty::addDynamicProperty() if the based type id is invalid
This commit is contained in:
wmayer
2022-01-19 10:48:00 +01:00
parent 80492d0b2a
commit 2a3991d799
3 changed files with 5 additions and 21 deletions

View File

@@ -205,7 +205,7 @@ class DocumentBasicCases(unittest.TestCase):
self.assertEqual(ext.createInstance(), None)
obj = self.Doc.addObject("App::FeaturePython", "Object")
with self.assertRaises(RuntimeError):
with self.assertRaises(TypeError):
obj.addProperty("App::DocumentObjectExtension", "Property")
with self.assertRaises(TypeError):