Py3 code deprecation fixes
authorStefan Behnel <scoder@users.berlios.de>
Sat, 17 Jan 2009 06:43:42 +0000 (07:43 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 17 Jan 2009 06:43:42 +0000 (07:43 +0100)
Cython/Compiler/PyrexTypes.py
Cython/Compiler/Symtab.py
Cython/Plex/Regexps.py

index 3c3dce07b62c936587a7f841c76bf0b4d8a8fb82..efc0124f6886c932a684c74c520cd4044264494c 100644 (file)
@@ -517,7 +517,7 @@ class CIntType(CNumericType):
         c_type = self.sign_and_name()
         c_name = c_type.replace(' ', '_');
         func_name = "__pyx_PyInt_%s" % c_name;
-        if not int_conversion_list.has_key(func_name):
+        if func_name not in int_conversion_list:
             # no env to add utility code to
             global type_conversion_predeclarations, type_conversion_functions
             if self.signed:
index 594561e3acbf2c0bfb0c0afbc46f0336f32767cc..bdefe2a69169ff372db7af1f839d81be53caf76c 100644 (file)
@@ -282,8 +282,8 @@ class Scope:
         if not self.in_cinclude and cname and re.match("^_[_A-Z]+$", cname):
             # See http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html#Reserved-Names 
             warning(pos, "'%s' is a reserved name in C." % cname, -1)
-        dict = self.entries
-        if name and dict.has_key(name):
+        entries = self.entries
+        if name and name in entries:
             if visibility == 'extern':
                 warning(pos, "'%s' redeclared " % name, 0)
             elif visibility != 'ignore':
@@ -292,7 +292,7 @@ class Scope:
         entry.in_cinclude = self.in_cinclude
         if name:
             entry.qualified_name = self.qualify_name(name)
-            dict[name] = entry
+            entries[name] = entry
         entry.scope = self
         entry.visibility = visibility
         return entry
index 9adc9b0349f4c91a16687fa6b74120c68590f154..03df826ec319d2b82a40eb9093784f7fcc43b58a 100644 (file)
@@ -83,7 +83,7 @@ def CodeRanges(code_list):
     re_list = []
     for i in xrange(0, len(code_list), 2):
         re_list.append(CodeRange(code_list[i], code_list[i + 1]))
-    return apply(Alt, tuple(re_list))
+    return Alt(*re_list)
 
 def CodeRange(code1, code2):
     """