]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#17526: merge with 3.3.
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 30 Mar 2013 03:19:06 +0000 (05:19 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 30 Mar 2013 03:19:06 +0000 (05:19 +0200)
1  2 
Lib/inspect.py
Lib/test/test_inspect.py
Misc/NEWS

diff --cc Lib/inspect.py
index 366131604287bc26e2932a7afe04ab7e25d2e53c,7834d12ea7d04419df27aa60512e24e94c23aa77..e60a235fe432f02ea5f374f0c35f602264ba92d8
@@@ -550,8 -550,8 +550,8 @@@ def findsource(object)
  
      file = getfile(object)
      sourcefile = getsourcefile(object)
-     if not sourcefile and file[0] + file[-1] != '<>':
+     if not sourcefile and file[:1] + file[-1:] != '<>':
 -        raise IOError('source code not available')
 +        raise OSError('source code not available')
      file = sourcefile if sourcefile else file
  
      module = getmodule(object, file)
Simple merge
diff --cc Misc/NEWS
index 5c2879ade9dc29852388db9e65320eb7cc405f57,c3e9ef2fa747358848184dd932eb212f55a79f46..2af6102d996f4f6405e1b40b136f8c76ccfa4f0d
+++ b/Misc/NEWS
@@@ -297,13 -211,8 +297,16 @@@ Core and Builtin
  Library
  -------
  
++- Issue #17526: fix an IndexError raised while passing code without filename to
++  inspect.findsource().  Initial patch by Tyler Doyle.
++
  - Issue #17540: Added style to formatter configuration by dict.
  
 +- Issue #16692: The ssl module now supports TLS 1.1 and TLS 1.2.  Initial
 +  patch by Michele OrrĂ¹.
 +
 +- Issue #17025: multiprocessing: Reduce Queue and SimpleQueue contention.
 +
  - Issue #17536: Add to webbrowser's browser list: www-browser, x-www-browser,
    iceweasel, iceape.