X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/754eecf69eed0bdc75fe224c19a702a4f0676807..b92ec348439edb8641204a102849bfab51f4dda0:/src/blackd/__init__.py diff --git a/src/blackd/__init__.py b/src/blackd/__init__.py index 10b6168..3e2a7e7 100644 --- a/src/blackd/__init__.py +++ b/src/blackd/__init__.py @@ -20,16 +20,9 @@ except ImportError as ie: sys.exit(-1) import black +from black.concurrency import maybe_install_uvloop import click -# If our environment has uvloop installed lets use it -try: - import uvloop - - uvloop.install() -except ImportError: - pass - from _black_version import version as __version__ # This is used internally by tests to shut down the server prematurely @@ -210,6 +203,7 @@ def parse_python_variant_header(value: str) -> Tuple[bool, Set[black.TargetVersi def patched_main() -> None: + maybe_install_uvloop() freeze_support() black.patch_click() main()