From 478920dc586458e49cd4801654b31f5c8ea58569 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 18 Dec 2021 14:54:32 -0700 Subject: [PATCH] moveconfig: Drop check for old Python Python 2 is not supported anymore and Python 3 has had subprocess.DEVNULL since version 3.3 which was released in 2012. Drop the unnecessary check. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- tools/moveconfig.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 521297f..0b33f31 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -91,14 +91,6 @@ SIZES = { } ### helper functions ### -def get_devnull(): - """Get the file object of '/dev/null' device.""" - try: - devnull = subprocess.DEVNULL # py3k - except AttributeError: - devnull = open(os.devnull, 'wb') - return devnull - def check_top_directory(): """Exit if we are not at the top of source directory.""" for f in ('README', 'Licenses'): @@ -1083,7 +1075,7 @@ class Slots: """ self.args = args self.slots = [] - devnull = get_devnull() + devnull = subprocess.DEVNULL make_cmd = get_make_cmd() for i in range(args.jobs): self.slots.append(Slot(toolchains, configs, args, progress, -- 2.7.4