Skip to content
Snippets Groups Projects
Commit 8130f638 authored by Ximin Luo's avatar Ximin Luo
Browse files

tests: fix progressbar failure that was exposed by the previous importing fixes

parent c07970f7
No related branches found
Tags debian/4.10.0-2
No related merge requests found
......@@ -24,7 +24,6 @@ import logging
logger = logging.getLogger(__name__)
class ProgressLoggingHandler(logging.StreamHandler):
def __init__(self, progressbar):
......@@ -201,6 +200,11 @@ class ProgressBar(object):
return '…{}'.format(msg[-width + 1:])
class OurProgressBar(progressbar.ProgressBar):
def __init__(self, *args, **kwargs):
# Remove after https://github.com/niltonvolpato/python-progressbar/pull/57 is fixed.
kwargs.setdefault("fd", sys.stderr)
super().__init__(*args, **kwargs)
def _need_update(self):
return True
......
......@@ -69,7 +69,7 @@ def module_is_not_importable(x):
# modules are not available, e.g. if we are running diffoscope using a
# non-default version of python, and the module uses extension modules
# that haven't been compiled for this version
__import__(x)
importlib.import_module(x)
except ImportError:
# Probing for submodules (eg. ``debian.deb822``) will attempt to
# import ``debian`` so we must handle that failing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment