[pypy-commit] pypy py3k: Fix some metaclasses, and the sys module can now be imported
amauryfa
noreply at buildbot.pypy.org
Wed Oct 12 22:23:21 CEST 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r47983:be8493f31b60
Date: 2011-10-12 22:19 +0200
http://bitbucket.org/pypy/pypy/changeset/be8493f31b60/
Log: Fix some metaclasses, and the sys module can now be imported
diff --git a/pypy/module/sys/system.py b/pypy/module/sys/system.py
--- a/pypy/module/sys/system.py
+++ b/pypy/module/sys/system.py
@@ -7,8 +7,7 @@
app = gateway.applevel("""
"NOT_RPYTHON"
from _structseq import structseqtype, structseqfield
-class float_info:
- __metaclass__ = structseqtype
+class float_info(metaclass=structseqtype):
max = structseqfield(0)
max_exp = structseqfield(1)
@@ -22,8 +21,7 @@
radix = structseqfield(9)
rounds = structseqfield(10)
-class long_info:
- __metaclass__ = structseqtype
+class long_info(metaclass=structseqtype):
bits_per_digit = structseqfield(0)
sizeof_digit = structseqfield(1)
""")
diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py
--- a/pypy/module/sys/version.py
+++ b/pypy/module/sys/version.py
@@ -41,8 +41,7 @@
app = gateway.applevel('''
"NOT_RPYTHON"
from _structseq import structseqtype, structseqfield
-class version_info:
- __metaclass__ = structseqtype
+class version_info(metaclass=structseqtype):
major = structseqfield(0, "Major release number")
minor = structseqfield(1, "Minor release number")
diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py
--- a/pypy/module/sys/vm.py
+++ b/pypy/module/sys/vm.py
@@ -159,8 +159,7 @@
"NOT_RPYTHON"
from _structseq import structseqtype, structseqfield
-class windows_version_info:
- __metaclass__ = structseqtype
+class windows_version_info(metaclass=structseqtype):
name = "sys.getwindowsversion"
More information about the pypy-commit
mailing list