mirror of https://github.com/pypa/pip
Prefer subprocess.DEVNULL over open(os.devnull, 'w')
Available since Python 3.3. https://docs.python.org/3/library/subprocess.html#subprocess.DEVNULL Use a context manager for the other opened file, dump.
This commit is contained in:
parent
609d9d4a68
commit
50517b2171
|
@ -22,15 +22,12 @@ def _create_svn_initools_repo(initools_dir):
|
||||||
'http://bitbucket.org/hltbra/pip-initools-dump/raw/8b55c908a320/'
|
'http://bitbucket.org/hltbra/pip-initools-dump/raw/8b55c908a320/'
|
||||||
'INITools_modified.dump'
|
'INITools_modified.dump'
|
||||||
)
|
)
|
||||||
devnull = open(os.devnull, 'w')
|
with open(filename) as dump:
|
||||||
dump = open(filename)
|
subprocess.check_call(
|
||||||
subprocess.check_call(
|
['svnadmin', 'load', initools_dir],
|
||||||
['svnadmin', 'load', initools_dir],
|
stdin=dump,
|
||||||
stdin=dump,
|
stdout=subprocess.DEVNULL,
|
||||||
stdout=devnull,
|
)
|
||||||
)
|
|
||||||
dump.close()
|
|
||||||
devnull.close()
|
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue