Author: Ronan Lamy <[email protected]>
Branch:
Changeset: r71056:c8e3b8cbc843
Date: 2014-04-29 01:36 +0100
http://bitbucket.org/pypy/pypy/changeset/c8e3b8cbc843/
Log: kill useless ClassMethods metaclass
diff --git a/rpython/rtyper/module/ll_os_path.py
b/rpython/rtyper/module/ll_os_path.py
--- a/rpython/rtyper/module/ll_os_path.py
+++ b/rpython/rtyper/module/ll_os_path.py
@@ -6,26 +6,24 @@
import stat
import os
-from rpython.tool.staticmethods import ClassMethods
# Does a path exist?
# This is false for dangling symbolic links.
-class BaseOsPath:
- __metaclass__ = ClassMethods
-
+class BaseOsPath(object):
+ @classmethod
def ll_os_path_exists(cls, path):
"""Test whether a path exists"""
try:
- st = os.stat(cls.from_rstr_nonnull(path))
+ os.stat(cls.from_rstr_nonnull(path))
except OSError:
return False
return True
+ @classmethod
def ll_os_path_isdir(cls, path):
try:
st = os.stat(cls.from_rstr_nonnull(path))
except OSError:
return False
return stat.S_ISDIR(st[0])
-
diff --git a/rpython/tool/staticmethods.py b/rpython/tool/staticmethods.py
--- a/rpython/tool/staticmethods.py
+++ b/rpython/tool/staticmethods.py
@@ -10,11 +10,5 @@
class StaticMethods(AbstractMethods):
"""
Metaclass that turns plain methods into staticmethods.
- """
+ """
decorator = staticmethod
-
-class ClassMethods(AbstractMethods):
- """
- Metaclass that turns plain methods into classmethods.
- """
- decorator = classmethod
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit