From 9cfba91cc6522a1d2431575bd3eb890feef2727c Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 1 Jul 2019 21:26:04 +0200 Subject: [PATCH] cope with ANY error when importing pytest into borg.testsuite, #4652 this happened because the user had pytest5 installed somehow, although it is incompatible with python 3.4: # python3 /usr/local/bin/borg --version Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 81, in from .selftest import selftest File "/usr/local/lib/python3.4/dist-packages/borg/selftest.py", line 21, in from .testsuite.hashindex import HashIndexDataTestCase, HashIndexRefcountingTestCase, HashIndexTestCase File "/usr/local/lib/python3.4/dist-packages/borg/testsuite/__init__.py", line 29, in from pytest import raises File "/usr/local/lib/python3.4/dist-packages/pytest.py", line 6, in from _pytest.assertion import register_assert_rewrite File "/usr/local/lib/python3.4/dist-packages/_pytest/assertion/__init__.py", line 6, in from _pytest.assertion import rewrite File "/usr/local/lib/python3.4/dist-packages/_pytest/assertion/rewrite.py", line 443, in ast.MatMult: "@", AttributeError: 'module' object has no attribute 'MatMult' --- src/borg/testsuite/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/testsuite/__init__.py b/src/borg/testsuite/__init__.py index 3dcafca55..a1ea1f88f 100644 --- a/src/borg/testsuite/__init__.py +++ b/src/borg/testsuite/__init__.py @@ -27,7 +27,7 @@ except ImportError: try: from pytest import raises -except ImportError: +except: # noqa raises = None has_lchflags = hasattr(os, 'lchflags') or sys.platform.startswith('linux')