from TypeSlots import method_coexist
from Scanning import SourceDescriptor
from Cython.StringIOTree import StringIOTree
-from sets import Set as set
+try:
+ set
+except NameError:
+ from sets import Set as set
class FunctionContext(object):
# Not used for now, perhaps later
# Try to calculate a hash code for the given source file.
# Returns an empty string if the file cannot be accessed.
#print "Hashing", path ###
- import md5
+ try:
+ from hashlib import md5 as new_md5
+ except ImportError:
+ from md5 import new as new_md5
try:
try:
f = open(path, "rU")
# tabs by a single space.
import re
text = re.sub("[ \t]+", " ", text)
- hash = md5.new(text).hexdigest()
+ hash = new_md5(text).hexdigest()
return hash
def open_pickled_lexicon(expected_hash):