diff --git a/lib/python/rose/apps/rose_ana_v1.py b/lib/python/rose/apps/rose_ana_v1.py index 0a9d1751ea..db06dc2d69 100644 --- a/lib/python/rose/apps/rose_ana_v1.py +++ b/lib/python/rose/apps/rose_ana_v1.py @@ -36,7 +36,6 @@ from rose.reporter import Reporter, Event from rose.resource import ResourceLocator from rose.app_run import BuiltinApp -import collections.abc WARN = -1 PASS = 0 diff --git a/lib/python/rose/cmp_source_vc.py b/lib/python/rose/cmp_source_vc.py index 3cbf60e893..d31a6036c4 100644 --- a/lib/python/rose/cmp_source_vc.py +++ b/lib/python/rose/cmp_source_vc.py @@ -30,7 +30,6 @@ from rose.reporter import Reporter from rose.run_source_vc import write_source_vc_info from rose.suite_engine_proc import SuiteEngineProcessor -import collections.abc class SuiteVCComparator(object): diff --git a/lib/python/rose/config_processor.py b/lib/python/rose/config_processor.py index dd2f8e60f3..7bda92dba8 100644 --- a/lib/python/rose/config_processor.py +++ b/lib/python/rose/config_processor.py @@ -25,7 +25,6 @@ from rose.popen import RosePopener from rose.scheme_handler import SchemeHandlersManager import sys -import collections.abc class UnknownContentError(Exception): diff --git a/lib/python/rose/config_processors/fileinstall.py b/lib/python/rose/config_processors/fileinstall.py index 2f0142a705..acc5dbafb5 100644 --- a/lib/python/rose/config_processors/fileinstall.py +++ b/lib/python/rose/config_processors/fileinstall.py @@ -38,7 +38,6 @@ import sys from tempfile import mkdtemp from urllib.parse import urlparse -import collections.abc class ConfigProcessorForFile(ConfigProcessorBase): diff --git a/lib/python/rose/env.py b/lib/python/rose/env.py index c62e9f273c..e9ffd0acdc 100644 --- a/lib/python/rose/env.py +++ b/lib/python/rose/env.py @@ -27,7 +27,6 @@ import os import re from rose.reporter import Event -import collections.abc # _RE_DEFAULT = re.compile(r""" diff --git a/lib/python/rose/fs_util.py b/lib/python/rose/fs_util.py index 15098f4437..bef3be24c8 100644 --- a/lib/python/rose/fs_util.py +++ b/lib/python/rose/fs_util.py @@ -23,7 +23,6 @@ import os from rose.reporter import Event import shutil -import collections.abc class FileSystemEvent(Event): diff --git a/lib/python/rose/host_select.py b/lib/python/rose/host_select.py index 13a3153f1d..a1d9615113 100644 --- a/lib/python/rose/host_select.py +++ b/lib/python/rose/host_select.py @@ -32,7 +32,6 @@ import sys from time import sleep, time import traceback -import collections.abc class NoHostError(Exception): diff --git a/lib/python/rose/macro.py b/lib/python/rose/macro.py index 778f196055..c0167ae4a9 100644 --- a/lib/python/rose/macro.py +++ b/lib/python/rose/macro.py @@ -57,7 +57,6 @@ def test_cleanup(stuff_to_remove): import rose.reporter import rose.resource import rose.variable -import collections.abc ALLOWED_MACRO_CLASS_METHODS = ["transform", "validate", "downgrade", "upgrade", diff --git a/lib/python/rose/popen.py b/lib/python/rose/popen.py index 2ff140046b..cd7b298240 100644 --- a/lib/python/rose/popen.py +++ b/lib/python/rose/popen.py @@ -27,7 +27,6 @@ import shlex from subprocess import Popen, PIPE import sys -import collections.abc class RosePopenError(Exception): diff --git a/lib/python/rose/reporter.py b/lib/python/rose/reporter.py index 7e725c0109..092ec58892 100644 --- a/lib/python/rose/reporter.py +++ b/lib/python/rose/reporter.py @@ -237,7 +237,7 @@ def get_prefix(self, kind, level): return self._tty_colour_err(Reporter.PREFIX_WARN) else: return self._tty_colour_err(Reporter.PREFIX_FAIL) - if isinstance(self.prefix, collections.abc.Callable): + if callable(self.prefix): return self.prefix(kind, level) else: return self.prefix diff --git a/lib/python/rose/run.py b/lib/python/rose/run.py index 4086b2215b..716c31db9d 100644 --- a/lib/python/rose/run.py +++ b/lib/python/rose/run.py @@ -30,7 +30,6 @@ import shlex import shutil from uuid import uuid4 -import collections.abc class RunConfigLoadEvent(Event): diff --git a/lib/python/rose/scheme_handler.py b/lib/python/rose/scheme_handler.py index 6fb386b111..ebf217c191 100644 --- a/lib/python/rose/scheme_handler.py +++ b/lib/python/rose/scheme_handler.py @@ -24,7 +24,6 @@ import inspect import os import sys -import collections.abc class SchemeHandlersManager(object): diff --git a/lib/python/rose/suite_engine_proc.py b/lib/python/rose/suite_engine_proc.py index 73aa60abeb..aed9949416 100644 --- a/lib/python/rose/suite_engine_proc.py +++ b/lib/python/rose/suite_engine_proc.py @@ -34,7 +34,6 @@ from rose.scheme_handler import SchemeHandlersManager import sys import webbrowser -import collections.abc class NoSuiteLogError(Exception): @@ -539,7 +538,7 @@ def get_version_env_name(self): def handle_event(self, *args, **kwargs): """Call self.event_handler if it is callable.""" - if isinstance(self.event_handler, collections.abc.Callable): + if callable(self.event_handler): return self.event_handler(*args, **kwargs) def gcontrol(self, suite_name, args=None): diff --git a/lib/python/rose/suite_hook.py b/lib/python/rose/suite_hook.py index a329911f88..857fb6f5e5 100644 --- a/lib/python/rose/suite_hook.py +++ b/lib/python/rose/suite_hook.py @@ -30,7 +30,6 @@ from rose.suite_engine_proc import SuiteEngineProcessor from smtplib import SMTP, SMTPException import socket -import collections.abc class RoseSuiteHook(object): @@ -49,7 +48,7 @@ def __init__(self, event_handler=None, popen=None, suite_engine_proc=None): def handle_event(self, *args, **kwargs): """Call self.event_handler if it is callabale.""" - if isinstance(self.event_handler, collections.abc.Callable): + if callable(self.event_handler): return self.event_handler(*args, **kwargs) def run(self, suite_name, task_id, hook_event, hook_message=None, diff --git a/lib/python/rose/suite_restart.py b/lib/python/rose/suite_restart.py index 4ef7e61234..a010436373 100644 --- a/lib/python/rose/suite_restart.py +++ b/lib/python/rose/suite_restart.py @@ -28,7 +28,6 @@ from rose.reporter import Reporter from rose.suite_control import get_suite_name, SuiteNotFoundError from rose.suite_engine_proc import SuiteEngineProcessor -import collections.abc class SuiteRestarter(object): @@ -42,7 +41,7 @@ def __init__(self, event_handler=None): def handle_event(self, *args, **kwargs): """Handle event.""" - if isinstance(self.event_handler, collections.abc.Callable): + if callable(self.event_handler): self.event_handler(*args, **kwargs) def restart( diff --git a/lib/python/rosie/db_create.py b/lib/python/rosie/db_create.py index 9b20b52f81..d3e9e06927 100644 --- a/lib/python/rosie/db_create.py +++ b/lib/python/rosie/db_create.py @@ -31,7 +31,6 @@ from rosie.db import ( LATEST_TABLE_NAME, MAIN_TABLE_NAME, META_TABLE_NAME, OPTIONAL_TABLE_NAME) from rosie.svn_post_commit import RosieSvnPostCommitHook -import collections.abc class RosieDatabaseCreateEvent(Event):