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
87b5c0ec
Commit
87b5c0ec
authored
Nov 13, 2002
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow unknown keyword arguments to the Extension class, and warn about them.
parent
02d558c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
extension.py
extension.py
+14
-1
No files found.
extension.py
View file @
87b5c0ec
...
...
@@ -10,6 +10,10 @@ __revision__ = "$Id$"
import
os
,
string
from
types
import
*
try
:
import
warnings
except
ImportError
:
warnings
=
None
# This class is really only used by the "build_ext" command, so it might
# make sense to put it in distutils.command.build_ext. However, that
...
...
@@ -93,8 +97,8 @@ class Extension:
export_symbols
=
None
,
depends
=
None
,
language
=
None
,
**
kw
# To catch unknown keywords
):
assert
type
(
name
)
is
StringType
,
"'name' must be a string"
assert
(
type
(
sources
)
is
ListType
and
map
(
type
,
sources
)
==
[
StringType
]
*
len
(
sources
)),
\
...
...
@@ -115,6 +119,15 @@ class Extension:
self
.
depends
=
depends
or
[]
self
.
language
=
language
# If there are unknown keyword options, warn about them
if
len
(
kw
):
L
=
kw
.
keys
()
;
L
.
sort
()
L
=
map
(
repr
,
L
)
msg
=
"Unknown Extension options: "
+
string
.
join
(
L
,
', '
)
if
warnings
is
not
None
:
warnings
.
warn
(
msg
)
else
:
sys
.
stderr
.
write
(
msg
+
'
\
n
'
)
# class Extension
...
...
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