summaryrefslogtreecommitdiff
path: root/Demo/metaclasses/Meta.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 +0000
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 +0000
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/metaclasses/Meta.py
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-git-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/metaclasses/Meta.py')
-rw-r--r--Demo/metaclasses/Meta.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Demo/metaclasses/Meta.py b/Demo/metaclasses/Meta.py
index 9529e0f8df..90bfd97d6e 100644
--- a/Demo/metaclasses/Meta.py
+++ b/Demo/metaclasses/Meta.py
@@ -31,7 +31,7 @@ class MetaHelper:
try:
ga = self.__formalclass__.__getattr__('__usergetattr__')
except (KeyError, AttributeError):
- raise AttributeError, name
+ raise AttributeError(name)
return ga(self, name)
if type(raw) != types.FunctionType:
return raw
@@ -71,7 +71,7 @@ class MetaClass:
return base.__getattr__(name)
except AttributeError:
pass
- raise AttributeError, name
+ raise AttributeError(name)
def __setattr__(self, name, value):
if not self.__inited:
@@ -96,20 +96,20 @@ Meta = MetaClass('Meta', (), {})
def _test():
class C(Meta):
def __init__(self, *args):
- print "__init__, args =", args
+ print("__init__, args =", args)
def m1(self, x):
- print "m1(x=%r)" % (x,)
- print C
+ print("m1(x=%r)" % (x,))
+ print(C)
x = C()
- print x
+ print(x)
x.m1(12)
class D(C):
def __getattr__(self, name):
- if name[:2] == '__': raise AttributeError, name
+ if name[:2] == '__': raise AttributeError(name)
return "getattr:%s" % name
x = D()
- print x.foo
- print x._foo
+ print(x.foo)
+ print(x._foo)
## print x.__foo
## print x.__foo__