From: ber Date: Wed, 22 Jun 2011 12:34:31 +0000 (+0000) Subject: Do not depend on a CPython implementation detail anymore to make Roundup X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bb531e3935aa5304a810e919737320ab439f0bc4;p=roundup.git 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. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4618 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 641dc60..cd01475 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,9 @@ Entries without name were done by Richard Jones. Fixed: +- 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. (Bernhard Reiter) - Yet another fix to the mail gateway, messages got *all* files of an issue, not just the new ones. Thanks to Rafal Bisingier for reporting and proposing a fix. The regression test was updated. diff --git a/roundup/instance.py b/roundup/instance.py index 4c8a97d..ad256f7 100644 --- a/roundup/instance.py +++ b/roundup/instance.py @@ -30,6 +30,7 @@ __docformat__ = 'restructuredtext' import os import sys +import __builtin__ from roundup import configuration, mailgw from roundup import hyperdb, backends, actions from roundup.cgi import client, templating @@ -86,7 +87,7 @@ class Tracker: sys.path.remove(libdir) def get_backend_name(self): - o = __builtins__['open'] + o = __builtin__.open f = o(os.path.join(self.config.DATABASE, 'backend_name')) name = f.readline().strip() f.close()