From cfb024751899cb66d94dd54e977d015e8b744af9 Mon Sep 17 00:00:00 2001 From: sammiee5311 <56215891+sammiee5311@users.noreply.github.com> Date: Tue, 11 May 2021 09:37:52 +0900 Subject: [PATCH] Update dev_setup.py remove some if and elif statements --- scripts/dev_setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index c902ad2442b8..645bcef71904 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -32,18 +32,16 @@ def pip_command(command, additional_dir=".", error_ok=False): def select_install_type(pkg, run_develop, exceptions): # the default for disable_develop will be false, which means `run_develop` will be true - argument = "" + argument, decision = {1: "", -1: "-e"}, 1 + if run_develop: - argument = "-e" + decision = -1 if pkg in exceptions: # opposite of whatever our decision was - if argument == "": - argument = "-e" - elif argument == "-e": - argument = "" + decision *= -1 - return argument + return argument[decision] # optional argument in a situation where we want to build a variable subset of packages parser = argparse.ArgumentParser(