10000 allow method chain on venv create · pythonanywhere/helper_scripts@f494f6a · GitHub
[go: up one dir, main page]

Skip to content

Commit f494f6a

Browse files
committed
allow method chain on venv create
1 parent 3f371fd commit f494f6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pythonanywhere/virtualenvs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def create(self, nuke):
2121
if nuke:
2222
command = f'rmvirtualenv {self.domain} && {command}'
2323
subprocess.check_call(['bash', '-c', f'source virtualenvwrapper.sh && {command}'])
24+
return self
2425

2526

2627
def pip_install(self, packages):
@@ -31,8 +32,7 @@ def pip_install(self, packages):
3132

3233
def create_virtualenv(name, python_version, packages, nuke):
3334
print(snakesay(f'Creating virtualenv with Python{python_version} and installing {packages}'))
34-
v = Virtualenv(name, python_version)
35-
v.create(nuke=nuke)
35+
v = Virtualenv(name, python_version).create(nuke=nuke)
3636
v.pip_install(packages)
3737
return v.path
3838

0 commit comments

Comments
 (0)
0