From 04342964157857532c06c3f4233398e285867bd5 Mon Sep 17 00:00:00 2001 From: meejah Date: Fri, 2 Apr 2021 19:57:22 -0600 Subject: [PATCH] still support py27 --- src/wormhole_transit_relay/test/test_rlimits.py | 5 ++++- src/wormhole_transit_relay/test/test_service.py | 5 ++++- src/wormhole_transit_relay/test/test_stats.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wormhole_transit_relay/test/test_rlimits.py b/src/wormhole_transit_relay/test/test_rlimits.py index 3ee23a9..1354c40 100644 --- a/src/wormhole_transit_relay/test/test_rlimits.py +++ b/src/wormhole_transit_relay/test/test_rlimits.py @@ -1,5 +1,8 @@ from __future__ import print_function, unicode_literals -from unittest import mock +try: + from unittest import mock +except ImportError: + import mock from twisted.trial import unittest from ..increase_rlimits import increase_rlimits diff --git a/src/wormhole_transit_relay/test/test_service.py b/src/wormhole_transit_relay/test/test_service.py index f72765c..003de32 100644 --- a/src/wormhole_transit_relay/test/test_service.py +++ b/src/wormhole_transit_relay/test/test_service.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals, print_function from twisted.trial import unittest -from unittest import mock +try: + from unittest import mock +except ImportError: + import mock from twisted.application.service import MultiService from .. import server_tap diff --git a/src/wormhole_transit_relay/test/test_stats.py b/src/wormhole_transit_relay/test/test_stats.py index 43b912f..1f114b1 100644 --- a/src/wormhole_transit_relay/test/test_stats.py +++ b/src/wormhole_transit_relay/test/test_stats.py @@ -1,6 +1,9 @@ from __future__ import print_function, unicode_literals import os, io, json, sqlite3 -from unittest import mock +try: + from unittest import mock +except ImportError: + import mock from twisted.trial import unittest from ..transit_server import Transit from .. import database