Skip to content

Commit

Permalink
Tidy up reversion of collections.abc.Callable from metomi#2286 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Mar 14, 2019
1 parent dbb9c64 commit da10d1c
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 19 deletions.
1 change: 0 additions & 1 deletion lib/python/rose/apps/rose_ana_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/cmp_source_vc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/config_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from rose.popen import RosePopener
from rose.scheme_handler import SchemeHandlersManager
import sys
import collections.abc


class UnknownContentError(Exception):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/config_processors/fileinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import sys
from tempfile import mkdtemp
from urllib.parse import urlparse
import collections.abc


class ConfigProcessorForFile(ConfigProcessorBase):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import os
import re
from rose.reporter import Event
import collections.abc


# _RE_DEFAULT = re.compile(r"""
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/fs_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import os
from rose.reporter import Event
import shutil
import collections.abc


class FileSystemEvent(Event):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/host_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import sys
from time import sleep, time
import traceback
import collections.abc


class NoHostError(Exception):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/popen.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import shlex
from subprocess import Popen, PIPE
import sys
import collections.abc


class RosePopenError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion lib/python/rose/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import shlex
import shutil
from uuid import uuid4
import collections.abc


class RunConfigLoadEvent(Event):
Expand Down
1 change: 0 additions & 1 deletion lib/python/rose/scheme_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import inspect
import os
import sys
import collections.abc


class SchemeHandlersManager(object):
Expand Down
3 changes: 1 addition & 2 deletions lib/python/rose/suite_engine_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from rose.scheme_handler import SchemeHandlersManager
import sys
import webbrowser
import collections.abc


class NoSuiteLogError(Exception):
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions lib/python/rose/suite_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from rose.suite_engine_proc import SuiteEngineProcessor
from smtplib import SMTP, SMTPException
import socket
import collections.abc


class RoseSuiteHook(object):
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions lib/python/rose/suite_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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(
Expand Down
1 change: 0 additions & 1 deletion lib/python/rosie/db_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit da10d1c

Please sign in to comment.