diff hgdemandimport/__init__.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents 670eb4fa1b86
children 40120de810ba
line wrap: on
line diff
--- a/hgdemandimport/__init__.py	Sat Oct 05 10:29:34 2019 -0400
+++ b/hgdemandimport/__init__.py	Sun Oct 06 09:45:02 2019 -0400
@@ -30,10 +30,10 @@
     '_imp',
     '_xmlplus',
     'fcntl',
-    'nt', # pathlib2 tests the existence of built-in 'nt' module
+    'nt',  # pathlib2 tests the existence of built-in 'nt' module
     'win32com.gen_py',
-    'win32com.shell', # 'appdirs' tries to import win32com.shell
-    '_winreg', # 2.7 mimetypes needs immediate ImportError
+    'win32com.shell',  # 'appdirs' tries to import win32com.shell
+    '_winreg',  # 2.7 mimetypes needs immediate ImportError
     'pythoncom',
     # imported by tarfile, not available under Windows
     'pwd',
@@ -46,16 +46,16 @@
     # setuptools' pkg_resources.py expects "from __main__ import x" to
     # raise ImportError if x not defined
     '__main__',
-    '_ssl', # conditional imports in the stdlib, issue1964
-    '_sre', # issue4920
+    '_ssl',  # conditional imports in the stdlib, issue1964
+    '_sre',  # issue4920
     'rfc822',
     'mimetools',
-    'sqlalchemy.events', # has import-time side effects (issue5085)
+    'sqlalchemy.events',  # has import-time side effects (issue5085)
     # setuptools 8 expects this module to explode early when not on windows
     'distutils.msvc9compiler',
     '__builtin__',
     'builtins',
-    'urwid.command_map', # for pudb
+    'urwid.command_map',  # for pudb
 }
 
 _pypy = '__pypy__' in sys.builtin_module_names
@@ -71,8 +71,11 @@
 disable = demandimport.disable
 deactivated = demandimport.deactivated
 
+
 def enable():
     # chg pre-imports modules so do not enable demandimport for it
-    if ('CHGINTERNALMARK' not in os.environ
-        and os.environ.get('HGDEMANDIMPORT') != 'disable'):
+    if (
+        'CHGINTERNALMARK' not in os.environ
+        and os.environ.get('HGDEMANDIMPORT') != 'disable'
+    ):
         demandimport.enable()