Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
b3004f5d
Commit
b3004f5d
authored
Oct 10, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle 2.4 dependancy for builtin set
parent
59840c9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+13
-7
runtests.py
runtests.py
+22
-1
No files found.
Cython/Compiler/Builtin.py
View file @
b3004f5d
...
...
@@ -5,6 +5,7 @@
from
Symtab
import
BuiltinScope
,
StructOrUnionScope
from
TypeSlots
import
Signature
import
PyrexTypes
import
__builtin__
builtin_function_table
=
[
# name, args, return, C API func, py equiv = "*"
...
...
@@ -105,17 +106,22 @@ builtin_types_table = [
(
"keys"
,
"O"
,
"O"
,
"PyDict_Keys"
),
(
"values"
,
"O"
,
"O"
,
"PyDict_Values"
)]),
(
"set"
,
"PySet_Type"
,
[(
"clear"
,
"O"
,
"i"
,
"PySet_Clear"
),
(
"discard"
,
"OO"
,
"i"
,
"PySet_Discard"
),
(
"add"
,
"OO"
,
"i"
,
"PySet_Add"
),
(
"pop"
,
"O"
,
"O"
,
"PySet_Pop"
)]),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
(
"slice"
,
"PySlice_Type"
,
[]),
(
"file"
,
"PyFile_Type"
,
[]),
]
if
'set'
in
__builtin__
.
__dict__
:
builtin_types_table
+=
[
(
"set"
,
"PySet_Type"
,
[(
"clear"
,
"O"
,
"i"
,
"PySet_Clear"
),
(
"discard"
,
"OO"
,
"i"
,
"PySet_Discard"
),
(
"add"
,
"OO"
,
"i"
,
"PySet_Add"
),
(
"pop"
,
"O"
,
"O"
,
"PySet_Pop"
)]),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
]
builtin_structs_table
=
[
(
'Py_buffer'
,
'Py_buffer'
,
...
...
runtests.py
View file @
b3004f5d
...
...
@@ -18,6 +18,10 @@ EXT_DEP_MODULES = {
'numpy'
:
re
.
compile
(
'.*
\
.
n
umpy_.*'
).
match
}
VER_DEP_MODULES
=
{
(
2
,
4
)
:
lambda
x
:
x
in
[
'run.set'
]
}
INCLUDE_DIRS
=
[
d
for
d
in
os
.
getenv
(
'INCLUDE'
,
''
).
split
(
os
.
pathsep
)
if
d
]
CFLAGS
=
os
.
getenv
(
'CFLAGS'
,
''
).
split
()
...
...
@@ -417,6 +421,22 @@ class MissingDependencyExcluder:
return
True
return
False
class
VersionDependencyExcluder
:
def
__init__
(
self
,
deps
):
# deps: { version : matcher func }
from
sys
import
version_info
self
.
exclude_matchers
=
[]
for
ver
,
matcher
in
deps
.
items
():
if
version_info
<
ver
:
self
.
exclude_matchers
.
append
(
matcher
)
self
.
tests_missing_deps
=
[]
def
__call__
(
self
,
testname
):
for
matcher
in
self
.
exclude_matchers
:
if
matcher
(
testname
):
self
.
tests_missing_deps
.
append
(
testname
)
return
True
return
False
if
__name__
==
'__main__'
:
from
optparse
import
OptionParser
parser
=
OptionParser
()
...
...
@@ -521,7 +541,8 @@ if __name__ == '__main__':
# which depends on them (by prefix)
missing_dep_excluder
=
MissingDependencyExcluder
(
EXT_DEP_MODULES
)
exclude_selectors
=
[
missing_dep_excluder
]
# want to pring msg at exit
version_dep_excluder
=
VersionDependencyExcluder
(
VER_DEP_MODULES
)
exclude_selectors
=
[
missing_dep_excluder
,
version_dep_excluder
]
# want to pring msg at exit
if
options
.
exclude
:
exclude_selectors
+=
[
re
.
compile
(
r
,
re
.
I
|
re
.
U
).
search
for
r
in
options
.
exclude
]
...
...
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