Skip to content

Commit

Permalink
fixed a bug for the else case
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwu committed Apr 26, 2022
1 parent 6f29a6d commit 004cb9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/tools/requirements_txt_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def clean_requires():


@click.command()
@click.option("--newreq", default=0, show_default=True)
@click.option("--newreq", is_flag=True, default=0, show_default=True)
def gen_requirements(newreq):
# write to tmp file
f = open("tmp_requirement.txt", "w")
if newreq:
# run pip freeze
requirements = subprocess.check_output(["pip", "freeze"])
requirements = str(
subprocess.check_output(["pip", "freeze"]).decode("UTF-8")
)
else:
f_r = open("requirements.txt", "r")
requirements = f_r.read() # type: ignore
Expand Down

0 comments on commit 004cb9b

Please sign in to comment.