提交 d6e8bd1a authored 作者: Joseph Turian's avatar Joseph Turian

Fixes to work under python2.4

上级 baa19200
...@@ -71,6 +71,8 @@ def _compile_dir(): ...@@ -71,6 +71,8 @@ def _compile_dir():
else: else:
# use (and possibly create) a default code cache location # use (and possibly create) a default code cache location
platform_id = platform.platform() + '-' + platform.processor() platform_id = platform.platform() + '-' + platform.processor()
import re
platform_id = re.sub("[\(\)\s]+", "_", platform_id)
cachedir = os.path.join(os.getenv('HOME'), '.omega', 'compiledir_'+platform_id) cachedir = os.path.join(os.getenv('HOME'), '.omega', 'compiledir_'+platform_id)
if not os.access(cachedir, os.R_OK | os.W_OK): if not os.access(cachedir, os.R_OK | os.W_OK):
#this may raise a number of problems, I think all of which are serious. #this may raise a number of problems, I think all of which are serious.
......
...@@ -8,6 +8,7 @@ import env ...@@ -8,6 +8,7 @@ import env
import features import features
import ext import ext
from python25 import all
__all__ = [ 'UNDEFINED', __all__ = [ 'UNDEFINED',
'current_mode', 'current_mode',
......
import sys
if sys.version_info[:2] < (2,5):
def all(iterable):
for element in iterable:
if not element:
return False
return True
else:
# Only bother with this else clause and the __all__ line if you are putting
# this in a separate file.
import __builtin__
all = __builtin__.all
__all__ = ['all']
...@@ -10,6 +10,8 @@ import unittest ...@@ -10,6 +10,8 @@ import unittest
from err import GofError from err import GofError
from utils import AbstractFunctionError from utils import AbstractFunctionError
from python25 import all
__all__ = ['is_result', 'ResultBase', 'BrokenLink', 'BrokenLinkError' ] __all__ = ['is_result', 'ResultBase', 'BrokenLink', 'BrokenLinkError' ]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论