comparison roundup/instance.py @ 4506:51aa98cda2cf

Do not depend on a CPython implementation detail anymore... ...to make Roundup more compatible with other Python implementation like PyPy. Closes issue2550707. Thanks to Christof Meerwald.
author Bernhard Reiter <Bernhard.Reiter@intevation.de>
date Wed, 22 Jun 2011 12:34:31 +0000
parents 80a9295a60fd
children 996cc758f704
comparison
equal deleted inserted replaced
4505:a00e0e73bb26 4506:51aa98cda2cf
28 """ 28 """
29 __docformat__ = 'restructuredtext' 29 __docformat__ = 'restructuredtext'
30 30
31 import os 31 import os
32 import sys 32 import sys
33 import __builtin__
33 from roundup import configuration, mailgw 34 from roundup import configuration, mailgw
34 from roundup import hyperdb, backends, actions 35 from roundup import hyperdb, backends, actions
35 from roundup.cgi import client, templating 36 from roundup.cgi import client, templating
36 from roundup.cgi import actions as cgi_actions 37 from roundup.cgi import actions as cgi_actions
37 38
84 self.db_open = 0 85 self.db_open = 0
85 if libdir in sys.path: 86 if libdir in sys.path:
86 sys.path.remove(libdir) 87 sys.path.remove(libdir)
87 88
88 def get_backend_name(self): 89 def get_backend_name(self):
89 o = __builtins__['open'] 90 o = __builtin__.open
90 f = o(os.path.join(self.config.DATABASE, 'backend_name')) 91 f = o(os.path.join(self.config.DATABASE, 'backend_name'))
91 name = f.readline().strip() 92 name = f.readline().strip()
92 f.close() 93 f.close()
93 return name 94 return name
94 95

Roundup Issue Tracker: http://roundup-tracker.org/