Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tweak config loader for PyPy compatibility. #331

Merged
merged 1 commit into from

2 participants

@takluyver
Owner

Antonio Cuni (user antocuni) has tested IPython on a trunk version of PyPy. Apparently this is the only change needed to get it working. See issue #327 for discussion of the patch.

closes gh-327

@fperez
Owner

Go for it, this looks harmless enough. And since Brian will be reworking the config stuff over the next few days, might as well have it pypy-ok so those guys can cleanly track our work and alert us of any incompatibilities.

Thanks, and also to @antocuni!

@ellisonbg, just a heads-up that I think this is good to go as-is. Remember to update off master for this small change any config work you might have; shouldn't cause any problems (famous last words :)

@takluyver takluyver merged commit 7eb58d3 into ipython:master
@damianavila damianavila referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 2, 2011
  1. @takluyver

    Tweak config loader for PyPy compatibility.

    Antonio Cuni authored takluyver committed
    closes gh-327
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 IPython/config/loader.py
View
7 IPython/config/loader.py
@@ -118,6 +118,11 @@ def __deepcopy__(self, memo):
return type(self)(copy.deepcopy(self.items()))
def __getitem__(self, key):
+ # We cannot use directly self._is_section_key, because it triggers
+ # infinite recursion on top of PyPy. Instead, we manually fish the
+ # bound method.
+ is_section_key = self.__class__._is_section_key.__get__(self)
+
# Because we use this for an exec namespace, we need to delegate
# the lookup of names in __builtin__ to itself. This means
# that you can't have section or attribute names that are
@@ -126,7 +131,7 @@ def __getitem__(self, key):
return getattr(__builtin__, key)
except AttributeError:
pass
- if self._is_section_key(key):
+ if is_section_key(key):
try:
return dict.__getitem__(self, key)
except KeyError:
Something went wrong with that request. Please try again.