Commit b469f471 authored by Stefan Behnel's avatar Stefan Behnel

Py2.6/3.0 import fixes

parent 6b760cb3
...@@ -6,9 +6,13 @@ from Cython.Compiler.TreeFragment import TreeFragment ...@@ -6,9 +6,13 @@ from Cython.Compiler.TreeFragment import TreeFragment
from Cython.Utils import EncodedString from Cython.Utils import EncodedString
from Cython.Compiler.Errors import CompileError from Cython.Compiler.Errors import CompileError
import PyrexTypes import PyrexTypes
from sets import Set as set
import textwrap
try:
set
except NameError:
from sets import Set as set
import textwrap
def dedent(text, reindent=0): def dedent(text, reindent=0):
text = textwrap.dedent(text) text = textwrap.dedent(text)
if reindent > 0: if reindent > 0:
......
...@@ -5,7 +5,10 @@ from Cython.Compiler.ExprNodes import * ...@@ -5,7 +5,10 @@ from Cython.Compiler.ExprNodes import *
from Cython.Compiler.TreeFragment import TreeFragment from Cython.Compiler.TreeFragment import TreeFragment
from Cython.Utils import EncodedString from Cython.Utils import EncodedString
from Cython.Compiler.Errors import CompileError from Cython.Compiler.Errors import CompileError
from sets import Set as set try:
set
except NameError:
from sets import Set as set
class NormalizeTree(CythonTransform): class NormalizeTree(CythonTransform):
""" """
......
...@@ -15,7 +15,10 @@ from TypeSlots import \ ...@@ -15,7 +15,10 @@ from TypeSlots import \
get_special_method_signature, get_property_accessor_signature get_special_method_signature, get_property_accessor_signature
import ControlFlow import ControlFlow
import __builtin__ import __builtin__
from sets import Set as set try:
set
except NameError:
from sets import Set as set
possible_identifier = re.compile(ur"(?![0-9])\w+$", re.U).match possible_identifier = re.compile(ur"(?![0-9])\w+$", re.U).match
nice_identifier = re.compile('^[a-zA-Z0-0_]+$').match nice_identifier = re.compile('^[a-zA-Z0-0_]+$').match
......
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