summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/python/xcontrolshape.py3
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py11
2 files changed, 8 insertions, 6 deletions
diff --git a/sw/qa/python/xcontrolshape.py b/sw/qa/python/xcontrolshape.py
index cfbcedba73c9..336a6d3449c0 100644
--- a/sw/qa/python/xcontrolshape.py
+++ b/sw/qa/python/xcontrolshape.py
@@ -23,7 +23,8 @@ class TestXControlShape(unittest.TestCase):
@classmethod
def tearDownClass(cls):
- cls._uno.tearDown()
+ if cls._uno:
+ cls._uno.tearDown()
def test_getAndSetControlShape(self):
xDoc = self.__class__._uno.openDocFromTDOC("xcontrolshape.odt")
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py
index 8b421e167c0c..e27f9e145de4 100644
--- a/unotest/source/python/org/libreoffice/unotest.py
+++ b/unotest/source/python/org/libreoffice/unotest.py
@@ -243,11 +243,12 @@ class UnoInProcess:
assert(self.xContext)
def tearDown(self):
if hasattr(self, 'xDoc'):
- self.xDoc.close(True)
- # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls
- # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be
- # garbage-collected after VCL has already been deinitialized:
- self.xDoc = None
+ if self.xDoc:
+ self.xDoc.close(True)
+ # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls
+ # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be
+ # garbage-collected after VCL has already been deinitialized:
+ self.xDoc = None
def simpleInvoke(connection, test):
try: