From 8a641b13c50cb2c2462da821351eece708c895e0 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Mon, 23 Aug 2021 15:37:50 -0700 Subject: [PATCH] Change sys.exit to Raise. --- src/blackd/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/blackd/__init__.py b/src/blackd/__init__.py index 3e2a7e7c30f..147dd072bb7 100644 --- a/src/blackd/__init__.py +++ b/src/blackd/__init__.py @@ -11,13 +11,11 @@ from aiohttp import web import aiohttp_cors except ImportError as ie: - print( + raise ImportError( f"aiohttp dependency is not installed: {ie}. " + "Please re-install black with the '[d]' extra install " - + "to obtain aiohttp_cors: `pip install black[d]`", - file=sys.stderr, + + "to obtain aiohttp_cors: `pip install black[d]`" ) - sys.exit(-1) import black from black.concurrency import maybe_install_uvloop