]> granicus.if.org Git - python/commitdiff
fix since difference formating of SyntaxErrors
authorBenjamin Peterson <benjamin@python.org>
Tue, 7 Apr 2009 15:52:05 +0000 (15:52 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 7 Apr 2009 15:52:05 +0000 (15:52 +0000)
Lib/test/test_generators.py
Lib/test/test_telnetlib.py

index b7c3fdcbe5473986dd631a9bb4b9c085633588be..b997ebc16578c94509ad8ec56405e0414d325988 100644 (file)
@@ -1564,7 +1564,8 @@ Check some syntax errors for yield expressions:
 >>> f=lambda: (yield 1),(yield 2)
 Traceback (most recent call last):
   ...
-SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[21]>, line 1)
+  File "<doctest test.test_generators.__test__.coroutine[21]>", line 1
+SyntaxError: 'yield' outside function
 
 >>> def f(): return lambda x=(yield): 1
 Traceback (most recent call last):
@@ -1574,17 +1575,20 @@ SyntaxError: 'return' with argument inside generator (<doctest test.test_generat
 >>> def f(): x = yield = y
 Traceback (most recent call last):
   ...
-SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[23]>, line 1)
+  File "<doctest test.test_generators.__test__.coroutine[23]>", line 1
+SyntaxError: assignment to yield expression not possible
 
 >>> def f(): (yield bar) = y
 Traceback (most recent call last):
   ...
-SyntaxError: can't assign to yield expression (<doctest test.test_generators.__test__.coroutine[24]>, line 1)
+  File "<doctest test.test_generators.__test__.coroutine[24]>", line 1
+SyntaxError: can't assign to yield expression
 
 >>> def f(): (yield bar) += y
 Traceback (most recent call last):
   ...
-SyntaxError: augmented assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[25]>, line 1)
+  File "<doctest test.test_generators.__test__.coroutine[25]>", line 1
+SyntaxError: augmented assignment to yield expression not possible
 
 
 Now check some throw() conditions:
index 16f7f935442bab778a5e82debdf0ade89c8268c4..94b1e73b235915da680cbbe046d9ac7e1c436ab0 100644 (file)
@@ -98,7 +98,7 @@ class GeneralTests(TestCase):
 
 def _read_setUp(self):
     # the blocking constant should be tuned!
-    self.blocking_timeout = 0.0
+    self.blocking_timeout = 0.1
     self.evt = threading.Event()
     self.dataq = Queue.Queue()
     self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)