Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
9e4208be
Commit
9e4208be
authored
Sep 17, 2013
by
Suresh V
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement for all downloaders and check file existence before removing
parent
115bb41b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
ez_setup.py
ez_setup.py
+14
-3
No files found.
ez_setup.py
View file @
9e4208be
...
...
@@ -162,7 +162,12 @@ def download_file_powershell(url, target):
'-Command'
,
"(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)"
%
vars
(),
]
subprocess
.
check_call
(
cmd
)
try
:
subprocess
.
check_call
(
cmd
)
except
subprocess
.
CalledProcessError
:
if
os
.
access
(
target
,
os
.
F_OK
):
os
.
unlink
(
target
)
raise
def
has_powershell
():
if
platform
.
system
()
!=
'Windows'
:
...
...
@@ -182,7 +187,12 @@ download_file_powershell.viable = has_powershell
def
download_file_curl
(
url
,
target
):
cmd
=
[
'curl'
,
url
,
'--silent'
,
'--output'
,
target
]
subprocess
.
check_call
(
cmd
)
try
:
subprocess
.
check_call
(
cmd
)
except
subprocess
.
CalledProcessError
:
if
os
.
access
(
target
,
os
.
F_OK
):
os
.
unlink
(
target
)
raise
def
has_curl
():
cmd
=
[
'curl'
,
'--version'
]
...
...
@@ -203,7 +213,8 @@ def download_file_wget(url, target):
try
:
subprocess
.
check_call
(
cmd
)
except
subprocess
.
CalledProcessError
:
os
.
unlink
(
target
)
if
os
.
access
(
target
,
os
.
F_OK
):
os
.
unlink
(
target
)
raise
def
has_wget
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment