Description: Compatibility with Python 3.7
Author: <pylama@c.michael-kaeufl.de>
Acked-By: Mattia Rizzolo <mattia@debian.org>
Bug-Debian: https://bugs.debian.org/904491
Origin: https://github.com/fmv1992/pylama/pull/2/commits/f835653e21e78c9c2577189956601089d8809f6b

--- a/pylama/config.py
+++ b/pylama/config.py
@@ -128,7 +128,7 @@
     "--hook", action="store_true", help="Install Git (Mercurial) hook.")
 
 PARSER.add_argument(
-    "--async", action="store_true",
+    "--async", action="store_true", dest='async_mode',
     help="Enable async mode. Useful for checking a lot of files. "
     "Unsupported with pylint.")
 
@@ -168,6 +168,8 @@
     if config:
         cfg = get_config(str(options.options), rootdir=rootdir)
         for opt, val in cfg.default.items():
+            if opt == 'async':
+                opt = 'async_mode'
             LOGGER.info('Find option %s (%s)', opt, val)
             passed_value = getattr(options, opt, _Default())
             if isinstance(passed_value, _Default):
@@ -199,9 +201,9 @@
         if isinstance(value, _Default):
             setattr(options, name, process_value(name, value.value))
 
-    if options.async and 'pylint' in options.linters:
+    if options.async_mode and 'pylint' in options.linters:
         LOGGER.warning('Can\'t parse code asynchronously with pylint enabled.')
-        options.async = False
+        options.async_mode = False
 
     return options
 
--- a/pylama/main.py
+++ b/pylama/main.py
@@ -7,7 +7,7 @@
 
 from .config import parse_options, CURDIR, setup_logger
 from .core import LOGGER, run
-from .async import check_async
+from .async_mode import check_async
 
 
 def check_path(options, rootdir=None, candidates=None, code=None):
@@ -43,7 +43,7 @@
 
         paths.append(path)
 
-    if options.async:
+    if options.async_mode:
         return check_async(paths, options, rootdir)
 
     errors = []
--- a/pylama/async.py
+++ /dev/null
@@ -1,75 +0,0 @@
-"""Support for checking code asynchronously."""
-
-import logging
-import threading
-
-try:
-    import Queue
-except ImportError:
-    import queue as Queue
-
-
-try:
-    import multiprocessing
-
-    CPU_COUNT = multiprocessing.cpu_count()
-
-except (ImportError, NotImplementedError):
-    CPU_COUNT = 1
-
-from .core import run
-
-
-LOGGER = logging.getLogger('pylama')
-
-
-class Worker(threading.Thread):
-    """Get tasks from queue and run."""
-
-    def __init__(self, path_queue, result_queue):
-        """ Init worker. """
-        threading.Thread.__init__(self)
-        self.path_queue = path_queue
-        self.result_queue = result_queue
-
-    def run(self):
-        """ Run tasks from queue. """
-        while True:
-            path, params = self.path_queue.get()
-            errors = run(path, **params)
-            self.result_queue.put(errors)
-            self.path_queue.task_done()
-
-
-def check_async(paths, options, rootdir=None):
-    """Check given paths asynchronously.
-
-    :return list: list of errors
-
-    """
-    LOGGER.info('Async code checking is enabled.')
-    path_queue = Queue.Queue()
-    result_queue = Queue.Queue()
-
-    for num in range(CPU_COUNT):
-        worker = Worker(path_queue, result_queue)
-        worker.setDaemon(True)
-        LOGGER.info('Start worker #%s', (num + 1))
-        worker.start()
-
-    for path in paths:
-        path_queue.put((path, dict(options=options, rootdir=rootdir)))
-
-    path_queue.join()
-
-    errors = []
-    while True:
-        try:
-            errors += result_queue.get(False)
-        except Queue.Empty:
-            break
-
-    return errors
-
-
-# pylama:ignore=W0212,D210,F0001
--- /dev/null
+++ b/pylama/async_mode.py
@@ -0,0 +1,75 @@
+"""Support for checking code asynchronously."""
+
+import logging
+import threading
+
+try:
+    import Queue
+except ImportError:
+    import queue as Queue
+
+
+try:
+    import multiprocessing
+
+    CPU_COUNT = multiprocessing.cpu_count()
+
+except (ImportError, NotImplementedError):
+    CPU_COUNT = 1
+
+from .core import run
+
+
+LOGGER = logging.getLogger('pylama')
+
+
+class Worker(threading.Thread):
+    """Get tasks from queue and run."""
+
+    def __init__(self, path_queue, result_queue):
+        """ Init worker. """
+        threading.Thread.__init__(self)
+        self.path_queue = path_queue
+        self.result_queue = result_queue
+
+    def run(self):
+        """ Run tasks from queue. """
+        while True:
+            path, params = self.path_queue.get()
+            errors = run(path, **params)
+            self.result_queue.put(errors)
+            self.path_queue.task_done()
+
+
+def check_async(paths, options, rootdir=None):
+    """Check given paths asynchronously.
+
+    :return list: list of errors
+
+    """
+    LOGGER.info('Async code checking is enabled.')
+    path_queue = Queue.Queue()
+    result_queue = Queue.Queue()
+
+    for num in range(CPU_COUNT):
+        worker = Worker(path_queue, result_queue)
+        worker.setDaemon(True)
+        LOGGER.info('Start worker #%s', (num + 1))
+        worker.start()
+
+    for path in paths:
+        path_queue.put((path, dict(options=options, rootdir=rootdir)))
+
+    path_queue.join()
+
+    errors = []
+    while True:
+        try:
+            errors += result_queue.get(False)
+        except Queue.Empty:
+            break
+
+    return errors
+
+
+# pylama:ignore=W0212,D210,F0001
