From 3238b9a009fd2234af33db717776c8223ea78a19 Mon Sep 17 00:00:00 2001 From: naelsondouglas Date: Sun, 31 Oct 2021 02:56:00 -0300 Subject: [PATCH] removed a default mutable argument pitfall --- create-workspace.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/create-workspace.py b/create-workspace.py index 197a2b3e0..e4f63b235 100755 --- a/create-workspace.py +++ b/create-workspace.py @@ -309,14 +309,15 @@ def initialize_workdir(workdir, gitdir): ) -def create_virtualenv(workdir, git_path, orchestrator=None, templates=[]): +def create_virtualenv(workdir, git_path, orchestrator=None, templates=None): import virtualenv if hasattr(virtualenv, 'create_environment'): virtualenv.create_environment(workdir) else: virtualenv.cli_run([workdir]) - + if not templates: + templates = [] print("[+] Update pip version ...") subprocess.check_call([ os.path.join(workdir, 'bin', 'pip'),