THRIFT-284. python: Update tutorial files to use repr
authorDavid Reiss <dreiss@apache.org>
Sat, 24 Jan 2009 19:37:41 +0000 (19:37 +0000)
committerDavid Reiss <dreiss@apache.org>
Sat, 24 Jan 2009 19:37:41 +0000 (19:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@737424 13f79535-47bb-0310-9956-ffa450edef68

tutorial/py/PythonClient.py
tutorial/py/PythonServer.py

index 05f1719..cf96040 100755 (executable)
@@ -44,7 +44,7 @@ try:
     quotient = client.calculate(1, work)
     print 'Whoa? You know how to divide by zero?'
   except InvalidOperation, io:
-    print 'InvalidOperation: %s' % (io.__str__())
+    print 'InvalidOperation: %r' % io
 
   work.op = Operation.SUBTRACT
   work.num1 = 15
index 111c44e..d7fc89c 100755 (executable)
@@ -25,7 +25,7 @@ class CalculatorHandler:
     return n1+n2
 
   def calculate(self, logid, work):
-    print 'calculate(%d, %s)' % (logid, work.__str__())
+    print 'calculate(%d, %r)' % (logid, work)
 
     if work.op == Operation.ADD:
       val = work.num1 + work.num2