mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Don't use context managers in the contrib scripts. Thanks to Hugo's eagle eyes.
This commit is contained in:
parent
b51d64ec6f
commit
69c33a4090
2 changed files with 9 additions and 6 deletions
|
@ -9,12 +9,12 @@ file_name = os.path.join(here, 'get-pip.py')
|
|||
|
||||
def main():
|
||||
sys.stdout.write("Creating pip bootstrapper...")
|
||||
script = generate_script(
|
||||
entry='import pip; pip.bootstrap()',
|
||||
packages=['pip'],
|
||||
)
|
||||
with open(file_name, 'w') as f:
|
||||
script = generate_script('import pip; pip.bootstrap()', ['pip'])
|
||||
f = open(file_name, 'w')
|
||||
try:
|
||||
f.write(script)
|
||||
finally:
|
||||
f.close()
|
||||
sys.stdout.write('done.\n')
|
||||
if hasattr(os, 'chmod'):
|
||||
oldmode = os.stat(file_name).st_mode & 07777
|
||||
|
|
|
@ -10,8 +10,11 @@ file_name = os.path.join(here, 'run-pip.py')
|
|||
def main():
|
||||
sys.stdout.write("Creating standalone pip...")
|
||||
script = generate_script('import pip; pip.main()', ['pip'])
|
||||
with open(file_name, 'w') as f:
|
||||
f = open(file_name, 'w')
|
||||
try:
|
||||
f.write(script)
|
||||
finally:
|
||||
f.close()
|
||||
sys.stdout.write('done.\n')
|
||||
if hasattr(os, 'chmod'):
|
||||
oldmode = os.stat(file_name).st_mode & 07777
|
||||
|
|
Loading…
Reference in a new issue