Commit b3004f5d authored by Robert Bradshaw's avatar Robert Bradshaw

handle 2.4 dependancy for builtin set

parent 59840c9a
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
from Symtab import BuiltinScope, StructOrUnionScope from Symtab import BuiltinScope, StructOrUnionScope
from TypeSlots import Signature from TypeSlots import Signature
import PyrexTypes import PyrexTypes
import __builtin__
builtin_function_table = [ builtin_function_table = [
# name, args, return, C API func, py equiv = "*" # name, args, return, C API func, py equiv = "*"
...@@ -105,17 +106,22 @@ builtin_types_table = [ ...@@ -105,17 +106,22 @@ builtin_types_table = [
("keys", "O", "O", "PyDict_Keys"), ("keys", "O", "O", "PyDict_Keys"),
("values","O", "O", "PyDict_Values")]), ("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", []), ("slice", "PySlice_Type", []),
("file", "PyFile_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 = [ builtin_structs_table = [
('Py_buffer', 'Py_buffer', ('Py_buffer', 'Py_buffer',
......
...@@ -18,6 +18,10 @@ EXT_DEP_MODULES = { ...@@ -18,6 +18,10 @@ EXT_DEP_MODULES = {
'numpy' : re.compile('.*\.numpy_.*').match 'numpy' : re.compile('.*\.numpy_.*').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 ] INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split() CFLAGS = os.getenv('CFLAGS', '').split()
...@@ -417,6 +421,22 @@ class MissingDependencyExcluder: ...@@ -417,6 +421,22 @@ class MissingDependencyExcluder:
return True return True
return False 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__': if __name__ == '__main__':
from optparse import OptionParser from optparse import OptionParser
parser = OptionParser() parser = OptionParser()
...@@ -521,7 +541,8 @@ if __name__ == '__main__': ...@@ -521,7 +541,8 @@ if __name__ == '__main__':
# which depends on them (by prefix) # which depends on them (by prefix)
missing_dep_excluder = MissingDependencyExcluder(EXT_DEP_MODULES) 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: if options.exclude:
exclude_selectors += [ re.compile(r, re.I|re.U).search for r in options.exclude ] exclude_selectors += [ re.compile(r, re.I|re.U).search for r in options.exclude ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment