Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Akhmerov
kwant
Commits
c867f67a
Commit
c867f67a
authored
8 years ago
by
Christoph Groth
Browse files
Options
Downloads
Patches
Plain Diff
setup.py: consistently use sys.exit
parent
d36b3aa3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+8
-8
8 additions, 8 deletions
setup.py
with
8 additions
and
8 deletions
setup.py
+
8
−
8
View file @
c867f67a
...
@@ -66,7 +66,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
...
@@ -66,7 +66,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
if
l
!=
config_file_option
or
not
config_file
:
if
l
!=
config_file_option
or
not
config_file
:
print
(
'
error: Expecting {}=PATH
'
.
format
(
config_file_option
),
print
(
'
error: Expecting {}=PATH
'
.
format
(
config_file_option
),
file
=
sys
.
stderr
)
file
=
sys
.
stderr
)
exit
(
1
)
sys
.
exit
(
1
)
sys
.
argv
.
pop
(
i
)
sys
.
argv
.
pop
(
i
)
break
break
else
:
else
:
...
@@ -88,7 +88,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
...
@@ -88,7 +88,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
if
long
in
configs
:
if
long
in
configs
:
print
(
'
Error: both {} and {} sections present in {}.
'
.
format
(
print
(
'
Error: both {} and {} sections present in {}.
'
.
format
(
short
,
long
,
config_file
))
short
,
long
,
config_file
))
exit
(
1
)
sys
.
exit
(
1
)
configs
[
long
]
=
configs
[
short
]
configs
[
long
]
=
configs
[
short
]
del
configs
[
short
]
del
configs
[
short
]
...
@@ -126,7 +126,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
...
@@ -126,7 +126,7 @@ def configure_extensions(exts, aliases=(), build_summary=None):
if
unknown_sections
:
if
unknown_sections
:
print
(
'
Error: Unknown sections in file {}: {}
'
.
format
(
print
(
'
Error: Unknown sections in file {}: {}
'
.
format
(
config_file
,
'
,
'
.
join
(
unknown_sections
)))
config_file
,
'
,
'
.
join
(
unknown_sections
)))
exit
(
1
)
sys
.
exit
(
1
)
return
exts
return
exts
...
@@ -314,7 +314,7 @@ class sdist(sdist_orig):
...
@@ -314,7 +314,7 @@ class sdist(sdist_orig):
print
(
"
Error:
"
,
manifest_in_file
,
print
(
"
Error:
"
,
manifest_in_file
,
"
file is missing and Git is not available
"
"
file is missing and Git is not available
"
"
to regenerate it.
"
,
file
=
sys
.
stderr
)
"
to regenerate it.
"
,
file
=
sys
.
stderr
)
exit
(
1
)
sys
.
exit
(
1
)
else
:
else
:
with
open
(
manifest
,
'
w
'
)
as
f
:
with
open
(
manifest
,
'
w
'
)
as
f
:
for
name
in
names
:
for
name
in
names
:
...
@@ -356,7 +356,7 @@ class test(test_orig):
...
@@ -356,7 +356,7 @@ class test(test_orig):
except
:
except
:
print
(
'
The Python package
"
pytest
"
is required to run tests.
'
,
print
(
'
The Python package
"
pytest
"
is required to run tests.
'
,
file
=
sys
.
stderr
)
file
=
sys
.
stderr
)
exit
(
1
)
sys
.
exit
(
1
)
errno
=
pytest
.
main
(
shlex
.
split
(
self
.
pytest_args
))
errno
=
pytest
.
main
(
shlex
.
split
(
self
.
pytest_args
))
sys
.
exit
(
errno
)
sys
.
exit
(
errno
)
...
@@ -475,7 +475,7 @@ def maybe_cythonize(exts):
...
@@ -475,7 +475,7 @@ def maybe_cythonize(exts):
ext
=
'
.cpp
'
ext
=
'
.cpp
'
else
:
else
:
print
(
'
Unknown language: {}
'
.
format
(
language
),
file
=
sys
.
stderr
)
print
(
'
Unknown language: {}
'
.
format
(
language
),
file
=
sys
.
stderr
)
exit
(
1
)
sys
.
exit
(
1
)
pyx_files
=
[]
pyx_files
=
[]
cythonized_files
=
[]
cythonized_files
=
[]
...
@@ -496,7 +496,7 @@ def maybe_cythonize(exts):
...
@@ -496,7 +496,7 @@ def maybe_cythonize(exts):
msg
=
"
Cython-generated file {} is missing.
"
msg
=
"
Cython-generated file {} is missing.
"
print
(
banner
(
"
Error
"
),
msg
.
format
(
f
),
""
,
print
(
banner
(
"
Error
"
),
msg
.
format
(
f
),
""
,
cython_help
,
banner
(),
sep
=
"
\n
"
,
file
=
sys
.
stderr
)
cython_help
,
banner
(),
sep
=
"
\n
"
,
file
=
sys
.
stderr
)
exit
(
1
)
sys
.
exit
(
1
)
for
f
in
pyx_files
+
kwargs
.
get
(
'
depends
'
,
[]):
for
f
in
pyx_files
+
kwargs
.
get
(
'
depends
'
,
[]):
if
f
==
config_file
:
if
f
==
config_file
:
...
@@ -525,7 +525,7 @@ def maybe_cythonize(exts):
...
@@ -525,7 +525,7 @@ def maybe_cythonize(exts):
print
(
banner
(
"
Error
"
if
error
else
"
Caution
"
),
msg
,
""
,
print
(
banner
(
"
Error
"
if
error
else
"
Caution
"
),
msg
,
""
,
cython_help
,
banner
(),
sep
=
"
\n
"
,
file
=
sys
.
stderr
)
cython_help
,
banner
(),
sep
=
"
\n
"
,
file
=
sys
.
stderr
)
if
error
:
if
error
:
exit
(
1
)
sys
.
exit
(
1
)
return
result
return
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment