X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ef7c45f28132a7704a4549072ce5b272034fa196..104aec555fae0883ef5b53709569bd9c4d420bc5:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 29fb244..60f4fa3 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -9,6 +9,7 @@ import io from multiprocessing import Manager, freeze_support import os from pathlib import Path +from pathspec.patterns.gitwildmatch import GitWildMatchPatternError import regex as re import signal import sys @@ -428,18 +429,21 @@ def main( content=code, fast=fast, write_back=write_back, mode=mode, report=report ) else: - sources = get_sources( - ctx=ctx, - src=src, - quiet=quiet, - verbose=verbose, - include=include, - exclude=exclude, - extend_exclude=extend_exclude, - force_exclude=force_exclude, - report=report, - stdin_filename=stdin_filename, - ) + try: + sources = get_sources( + ctx=ctx, + src=src, + quiet=quiet, + verbose=verbose, + include=include, + exclude=exclude, + extend_exclude=extend_exclude, + force_exclude=force_exclude, + report=report, + stdin_filename=stdin_filename, + ) + except GitWildMatchPatternError: + ctx.exit(1) path_empty( sources,