From: Ɓukasz Langa Date: Mon, 4 Jun 2018 18:06:38 +0000 (-0700) Subject: [trivial] Simplify stdin handling X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1aa14c5db05681a2c25b2c3757d3f8d8f3bbe85f [trivial] Simplify stdin handling --- diff --git a/black.py b/black.py index 730c64d..0dce397 100644 --- a/black.py +++ b/black.py @@ -260,11 +260,9 @@ def main( sources.extend( gen_python_files_in_dir(p, root, include_regex, exclude_regex) ) - elif p.is_file(): + elif p.is_file() or s == "-": # if a file was explicitly given, we don't care about its extension sources.append(p) - elif s == "-": - sources.append(Path("-")) else: err(f"invalid path: {s}")