[pypy-commit] pypy default: small cleanup
rlamy
pypy.commits at gmail.com
Wed Mar 9 12:52:21 EST 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r82916:6e82c4562984
Date: 2016-03-09 17:51 +0000
http://bitbucket.org/pypy/pypy/changeset/6e82c4562984/
Log: small cleanup
diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -3,7 +3,7 @@
from pypy.interpreter import gateway
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import W_Root
-import os, sys
+import sys
class MixedModule(Module):
applevel_name = None
@@ -60,7 +60,7 @@
def save_module_content_for_future_reload(self):
self.w_initialdict = self.space.call_method(self.w_dict, 'items')
-
+ @classmethod
def get_applevel_name(cls):
""" NOT_RPYTHON """
if cls.applevel_name is not None:
@@ -68,7 +68,6 @@
else:
pkgroot = cls.__module__
return pkgroot.split('.')[-1]
- get_applevel_name = classmethod(get_applevel_name)
def get(self, name):
space = self.space
@@ -103,7 +102,7 @@
# be normal Functions to get the correct binding behaviour
func = w_value
if (isinstance(func, Function) and
- type(func) is not BuiltinFunction):
+ type(func) is not BuiltinFunction):
try:
bltin = func._builtinversion_
except AttributeError:
@@ -115,7 +114,6 @@
space.setitem(self.w_dict, w_name, w_value)
return w_value
-
def getdict(self, space):
if self.lazy:
for name in self.loaders:
@@ -131,6 +129,7 @@
self.startup_called = False
self._frozen = True
+ @classmethod
def buildloaders(cls):
""" NOT_RPYTHON """
if not hasattr(cls, 'loaders'):
@@ -149,8 +148,6 @@
if '__doc__' not in loaders:
loaders['__doc__'] = cls.get__doc__
- buildloaders = classmethod(buildloaders)
-
def extra_interpdef(self, name, spec):
cls = self.__class__
pkgroot = cls.__module__
@@ -159,21 +156,21 @@
w_obj = loader(space)
space.setattr(space.wrap(self), space.wrap(name), w_obj)
+ @classmethod
def get__doc__(cls, space):
return space.wrap(cls.__doc__)
- get__doc__ = classmethod(get__doc__)
def getinterpevalloader(pkgroot, spec):
""" NOT_RPYTHON """
def ifileloader(space):
- d = {'space' : space}
+ d = {'space':space}
# EVIL HACK (but it works, and this is not RPython :-)
while 1:
try:
value = eval(spec, d)
except NameError, ex:
- name = ex.args[0].split("'")[1] # super-Evil
+ name = ex.args[0].split("'")[1] # super-Evil
if name in d:
raise # propagate the NameError
try:
More information about the pypy-commit
mailing list