All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b97a4ac)
The fix for #1688 in #1761 breaks help("modules") introspection and also leads
to unhappy results when inadvertently importing blackd from Python. Basically
the sys.exit(-1) causes the whole Python REPL to exit -- not great to suffice.
Commit history before merge:
* Change sys.exit to Raise.
* Add #2440 to changelog.
* Fix lint error from prettier
* Remove exception chain for more helpful user message.
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
- The failsafe for accidentally added backslashes in f-string expressions has been
hardened to handle more edge cases during quote normalization (#2437)
- The failsafe for accidentally added backslashes in f-string expressions has been
hardened to handle more edge cases during quote normalization (#2437)
+### _Blackd_
+
+- Replace sys.exit(-1) with raise ImportError (#2440)
+
### Integrations
- The provided pre-commit hooks no longer specify `language_version` to avoid overriding
### Integrations
- The provided pre-commit hooks no longer specify `language_version` to avoid overriding
import asyncio
import logging
import asyncio
import logging
from concurrent.futures import Executor, ProcessPoolExecutor
from datetime import datetime
from functools import partial
from concurrent.futures import Executor, ProcessPoolExecutor
from datetime import datetime
from functools import partial
from aiohttp import web
import aiohttp_cors
except ImportError as ie:
from aiohttp import web
import aiohttp_cors
except ImportError as ie:
f"aiohttp dependency is not installed: {ie}. "
+ "Please re-install black with the '[d]' extra install "
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,
- )
- sys.exit(-1)
+ + "to obtain aiohttp_cors: `pip install black[d]`"
+ ) from None
import black
from black.concurrency import maybe_install_uvloop
import black
from black.concurrency import maybe_install_uvloop