Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3cfdd9c

Browse files
committed
Merged revisions 73186,73206,73212 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r73186 | georg.brandl | 2009-06-03 23:21:09 +0200 (Mi, 03 Jun 2009) | 1 line #6174: fix indentation in code example. ........ r73206 | georg.brandl | 2009-06-04 11:15:12 +0200 (Do, 04 Jun 2009) | 1 line #3584: ignore trailing newlines when placing the caret for a SyntaxError location. ........ r73212 | georg.brandl | 2009-06-04 12:10:41 +0200 (Do, 04 Jun 2009) | 1 line Better name for "Ctor". ........
1 parent 706824f commit 3cfdd9c

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

Doc/whatsnew/2.6.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,15 +682,15 @@ and :meth:`Semaphore` to create shared locks.)
682682
for N in range(1, 1000, 10):
683683
p.apply_async(factorial, (N, d))
684684

685-
# Mark pool as closed -- no more tasks can be added.
686-
p.close()
685+
# Mark pool as closed -- no more tasks can be added.
686+
p.close()
687687

688-
# Wait for tasks to exit
689-
p.join()
688+
# Wait for tasks to exit
689+
p.join()
690690

691-
# Output results
692-
for k, v in sorted(d.items()):
693-
print k, v
691+
# Output results
692+
for k, v in sorted(d.items()):
693+
print k, v
694694

695695
This will produce the output::
696696

Lib/test/test_with.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ def __exit__(self, *exc_info):
677677
if self.gobble:
678678
return True
679679

680-
class CtorRaises(object):
680+
class InitRaises(object):
681681
def __init__(self): raise RuntimeError()
682682

683683
class EnterRaises(object):
@@ -697,7 +697,7 @@ def testNoExceptions(self):
697697

698698
def testExceptionInExprList(self):
699699
try:
700-
with self.Dummy() as a, self.CtorRaises():
700+
with self.Dummy() as a, self.InitRaises():
701701
pass
702702
except:
703703
pass

Lib/traceback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def format_exception_only(etype, value):
225225
if badline is not None:
226226
lines.append(' %s\n' % badline.strip())
227227
if offset is not None:
228-
caretspace = badline[:offset].lstrip()
228+
caretspace = badline.rstrip('\n')[:offset].lstrip()
229229
# non-space whitespace (likes tabs) must be kept for alignment
230230
caretspace = ((c.isspace() and c or ' ') for c in caretspace)
231231
# only three spaces to account for offset1 == pos 0

0 commit comments

Comments
 (0)