From 1aa14c5db05681a2c25b2c3757d3f8d8f3bbe85f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Mon, 4 Jun 2018 11:06:38 -0700 Subject: [PATCH] [trivial] Simplify stdin handling --- black.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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}") -- 2.39.2