diff -r 55f62fa5bebc Lib/_pyio.py --- a/Lib/_pyio.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/_pyio.py Wed Apr 16 13:51:52 2014 -0400 @@ -368,7 +368,7 @@ # the end users, we suppress the traceback. try: self.close() - except: + except Exception: pass ### Inquiries ### diff -r 55f62fa5bebc Lib/_sitebuiltins.py --- a/Lib/_sitebuiltins.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/_sitebuiltins.py Wed Apr 16 13:51:52 2014 -0400 @@ -21,7 +21,7 @@ # stdin wrapper is closed. try: sys.stdin.close() - except: + except Exception: pass raise SystemExit(code) diff -r 55f62fa5bebc Lib/cgitb.py --- a/Lib/cgitb.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/cgitb.py Wed Apr 16 13:51:52 2014 -0400 @@ -307,7 +307,7 @@ self.file.write(msg + '\n') try: self.file.flush() - except: pass + except Exception: pass handler = Hook().handle def enable(display=1, logdir=None, context=5, format="html"): diff -r 55f62fa5bebc Lib/copyreg.py --- a/Lib/copyreg.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/copyreg.py Wed Apr 16 13:51:52 2014 -0400 @@ -135,7 +135,7 @@ # Cache the outcome in the class if at all possible try: cls.__slotnames__ = names - except: + except Exception: pass # But don't die if we can't return names diff -r 55f62fa5bebc Lib/curses/__init__.py --- a/Lib/curses/__init__.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/curses/__init__.py Wed Apr 16 13:51:52 2014 -0400 @@ -88,7 +88,7 @@ # module -- the error return from C start_color() is ignorable. try: start_color() - except: + except Exception: pass return func(stdscr, *args, **kwds) diff -r 55f62fa5bebc Lib/distutils/core.py --- a/Lib/distutils/core.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/distutils/core.py Wed Apr 16 13:51:52 2014 -0400 @@ -221,7 +221,7 @@ # Hmm, should we do something if exiting with a non-zero code # (ie. error)? pass - except: + except Exception: raise if _setup_distribution is None: diff -r 55f62fa5bebc Lib/distutils/tests/test_archive_util.py --- a/Lib/distutils/tests/test_archive_util.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/distutils/tests/test_archive_util.py Wed Apr 16 13:51:52 2014 -0400 @@ -276,7 +276,7 @@ try: try: make_archive('xxx', 'xxx', root_dir=self.mkdtemp()) - except: + except Exception: pass self.assertEqual(os.getcwd(), current_dir) finally: diff -r 55f62fa5bebc Lib/email/_header_value_parser.py --- a/Lib/email/_header_value_parser.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/email/_header_value_parser.py Wed Apr 16 13:51:52 2014 -0400 @@ -2679,7 +2679,7 @@ else: try: token, rest = get_extended_attrtext(inner_value) - except: + except Exception: pass else: if not rest: diff -r 55f62fa5bebc Lib/idlelib/Debugger.py --- a/Lib/idlelib/Debugger.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/idlelib/Debugger.py Wed Apr 16 13:51:52 2014 -0400 @@ -169,7 +169,7 @@ if value is not None: try: m1 = "%s: %s" % (m1, str(value)) - except: + except Exception: pass bg = "yellow" else: diff -r 55f62fa5bebc Lib/idlelib/ObjectBrowser.py --- a/Lib/idlelib/ObjectBrowser.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/idlelib/ObjectBrowser.py Wed Apr 16 13:51:52 2014 -0400 @@ -35,7 +35,7 @@ try: value = eval(text) self.setfunction(value) - except: + except Exception: pass else: self.object = value @@ -97,7 +97,7 @@ keys = list(self.object.keys()) try: keys.sort() - except: + except Exception: pass return keys diff -r 55f62fa5bebc Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/idlelib/PyShell.py Wed Apr 16 13:51:52 2014 -0400 @@ -159,7 +159,7 @@ try: # update the subprocess debugger debug = self.flist.pyshell.interp.debugger debug.set_breakpoint_here(filename, lineno) - except: # but debugger may not be active right now.... + except Exception: # but debugger may not be active right now.... pass def set_breakpoint_here(self, event=None): @@ -180,14 +180,14 @@ lineno = int(float(text.index("insert"))) try: self.breakpoints.remove(lineno) - except: + except Exception: pass text.tag_remove("BREAK", "insert linestart",\ "insert lineend +1char") try: debug = self.flist.pyshell.interp.debugger debug.clear_breakpoint_here(filename, lineno) - except: + except Exception: pass def clear_file_breaks(self): @@ -202,7 +202,7 @@ try: debug = self.flist.pyshell.interp.debugger debug.clear_file_breaks(filename) - except: + except Exception: pass def store_file_breaks(self): @@ -464,7 +464,7 @@ try: # Only close subprocess debugger, don't unregister gui_adap! RemoteDebugger.close_subprocess_debugger(self.rpcclt) - except: + except Exception: pass # Kill subprocess, spawn a new one, accept connection. self.rpcclt.close() @@ -1083,7 +1083,7 @@ try: if self.text.compare("sel.first", "!=", "sel.last"): return # Active selection -- always use default binding - except: + except Exception: pass if not (self.executing or self.reading): self.resetoutput() @@ -1136,7 +1136,7 @@ if self.text.compare("sel.last", "<=", "iomark"): self.recall(sel, event) return "break" - except: + except Exception: pass # If we're strictly before the line containing iomark, recall # the current line, less a leading prompt, less leading or diff -r 55f62fa5bebc Lib/imaplib.py --- a/Lib/imaplib.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/imaplib.py Wed Apr 16 13:51:52 2014 -0400 @@ -1176,7 +1176,7 @@ while n: try: self._mesg(*self._cmd_log[i]) - except: + except Exception: pass i += 1 if i>= self._cmd_log_len: diff -r 55f62fa5bebc Lib/multiprocessing/semaphore_tracker.py --- a/Lib/multiprocessing/semaphore_tracker.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/multiprocessing/semaphore_tracker.py Wed Apr 16 13:51:52 2014 -0400 @@ -118,7 +118,7 @@ except Exception: try: sys.excepthook(*sys.exc_info()) - except: + except Exception: pass finally: # all processes have terminated; cleanup any remaining semaphores diff -r 55f62fa5bebc Lib/pdb.py --- a/Lib/pdb.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/pdb.py Wed Apr 16 13:51:52 2014 -0400 @@ -1169,7 +1169,7 @@ """ try: self.message(repr(self._getval(arg))) - except: + except Exception: pass def do_pp(self, arg): @@ -1178,7 +1178,7 @@ """ try: self.message(pprint.pformat(self._getval(arg))) - except: + except Exception: pass complete_print = _complete_expression diff -r 55f62fa5bebc Lib/pstats.py --- a/Lib/pstats.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/pstats.py Wed Apr 16 13:51:52 2014 -0400 @@ -98,7 +98,7 @@ try: file_stats = os.stat(arg) arg = time.ctime(file_stats.st_mtime) + " " + arg - except: # in case this is not unix + except Exception: # in case this is not unix pass self.files = [arg] elif hasattr(arg, 'create_stats'): diff -r 55f62fa5bebc Lib/pyclbr.py --- a/Lib/pyclbr.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/pyclbr.py Wed Apr 16 13:51:52 2014 -0400 @@ -252,7 +252,7 @@ _readmodule(mod, path, inpackage) except ImportError: _readmodule(mod, []) - except: + except Exception: # If we can't find or parse the imported module, # too bad -- don't die here. pass @@ -264,7 +264,7 @@ try: # Recursively read the imported module d = _readmodule(mod, path, inpackage) - except: + except Exception: # If we can't find or parse the imported module, # too bad -- don't die here. continue diff -r 55f62fa5bebc Lib/test/crashers/trace_at_recursion_limit.py --- a/Lib/test/crashers/trace_at_recursion_limit.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/crashers/trace_at_recursion_limit.py Wed Apr 16 13:51:52 2014 -0400 @@ -14,7 +14,7 @@ if True: # change to True to crash interpreter try: x() - except: + except Exception: pass return g diff -r 55f62fa5bebc Lib/test/support/__init__.py --- a/Lib/test/support/__init__.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/support/__init__.py Wed Apr 16 13:51:52 2014 -0400 @@ -1850,7 +1850,7 @@ pid, status = os.waitpid(any_process, os.WNOHANG) if pid == 0: break - except: + except Exception: break @contextlib.contextmanager diff -r 55f62fa5bebc Lib/test/test_asynchat.py --- a/Lib/test/test_asynchat.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_asynchat.py Wed Apr 16 13:51:52 2014 -0400 @@ -58,7 +58,7 @@ n = conn.send(self.buffer[:self.chunk_size]) time.sleep(0.001) self.buffer = self.buffer[n:] - except: + except Exception: pass conn.close() diff -r 55f62fa5bebc Lib/test/test_asyncio/test_events.py --- a/Lib/test/test_asyncio/test_events.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_asyncio/test_events.py Wed Apr 16 13:51:52 2014 -0400 @@ -555,7 +555,7 @@ sock.setblocking(False) self.loop.run_until_complete( self.loop.sock_connect(sock, address)) - except: + except Exception: pass else: break diff -r 55f62fa5bebc Lib/test/test_compileall.py --- a/Lib/test/test_compileall.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_compileall.py Wed Apr 16 13:51:52 2014 -0400 @@ -67,7 +67,7 @@ for fn in (self.bc_path, self.bc_path2): try: os.unlink(fn) - except: + except Exception: pass compileall.compile_file(self.source_path, force=False, quiet=True) self.assertTrue(os.path.isfile(self.bc_path) and diff -r 55f62fa5bebc Lib/test/test_descr.py --- a/Lib/test/test_descr.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_descr.py Wed Apr 16 13:51:52 2014 -0400 @@ -2749,7 +2749,7 @@ ## finally: ## try: ## f.close() - ## except: + ## except Exception: ## pass ## support.unlink(support.TESTFN) @@ -4498,7 +4498,7 @@ pass try: pow(0, UserLong(), 0) - except: + except Exception: pass # Another segfault only when run early diff -r 55f62fa5bebc Lib/test/test_exceptions.py --- a/Lib/test/test_exceptions.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_exceptions.py Wed Apr 16 13:51:52 2014 -0400 @@ -531,7 +531,7 @@ wr = weakref.ref(obj) try: inner_raising_func() - except: + except Exception: pass obj = None obj = wr() @@ -759,7 +759,7 @@ e = () try: raise Exception(MyObject()) - except: + except Exception: pass self.assertEqual(e, (None, None, None)) diff -r 55f62fa5bebc Lib/test/test_fileio.py --- a/Lib/test/test_fileio.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_fileio.py Wed Apr 16 13:51:52 2014 -0400 @@ -441,7 +441,7 @@ finally: try: os.unlink(TESTFN) - except: + except Exception: pass def testInvalidInit(self): diff -r 55f62fa5bebc Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_httpservers.py Wed Apr 16 13:51:52 2014 -0400 @@ -253,7 +253,7 @@ os.chdir(self.cwd) try: shutil.rmtree(self.tempdir) - except: + except Exception: pass finally: BaseTestCase.tearDown(self) diff -r 55f62fa5bebc Lib/test/test_mmap.py --- a/Lib/test/test_mmap.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_mmap.py Wed Apr 16 13:51:52 2014 -0400 @@ -645,7 +645,7 @@ m = mmap.mmap(-1, 1000, tagname="foo") try: mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size - except: + except Exception: pass m.close() @@ -657,11 +657,11 @@ f.close() try: m.resize(0) # will raise OSError - except: + except Exception: pass try: m[:] - except: + except Exception: pass m.close() diff -r 55f62fa5bebc Lib/test/test_opcodes.py --- a/Lib/test/test_opcodes.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_opcodes.py Wed Apr 16 13:51:52 2014 -0400 @@ -14,7 +14,7 @@ except ZeroDivisionError: pass except TypeError: pass try: pass - except: pass + except Exception: pass try: pass finally: pass n = n+i @@ -31,7 +31,7 @@ pass try: raise AClass() - except: pass + except Exception: pass try: raise AClass() except AClass: pass @@ -41,7 +41,7 @@ try: raise BClass() except CClass: self.fail() - except: pass + except Exception: pass a = AClass() b = BClass() diff -r 55f62fa5bebc Lib/test/test_plistlib.py --- a/Lib/test/test_plistlib.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_plistlib.py Wed Apr 16 13:51:52 2014 -0400 @@ -97,7 +97,7 @@ def tearDown(self): try: os.unlink(support.TESTFN) - except: + except Exception: pass def _create(self, fmt=None): diff -r 55f62fa5bebc Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_shutil.py Wed Apr 16 13:51:52 2014 -0400 @@ -1431,7 +1431,7 @@ try: if d: shutil.rmtree(d) - except: + except Exception: pass def _check_move_file(self, src, dst, real_dst): @@ -1474,7 +1474,7 @@ finally: try: shutil.rmtree(dst_dir) - except: + except Exception: pass @mock_rename diff -r 55f62fa5bebc Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_ssl.py Wed Apr 16 13:51:52 2014 -0400 @@ -1785,7 +1785,7 @@ while self.active: try: asyncore.loop(1) - except: + except Exception: pass def stop(self): diff -r 55f62fa5bebc Lib/test/test_syntax.py --- a/Lib/test/test_syntax.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_syntax.py Wed Apr 16 13:51:52 2014 -0400 @@ -274,7 +274,7 @@ ... finally: ... try: ... continue - ... except: + ... except Exception: ... pass Traceback (most recent call last): ... @@ -318,7 +318,7 @@ ... finally: ... try: ... pass - ... except: + ... except Exception: ... continue Traceback (most recent call last): ... diff -r 55f62fa5bebc Lib/test/test_sys_setprofile.py --- a/Lib/test/test_sys_setprofile.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_sys_setprofile.py Wed Apr 16 13:51:52 2014 -0400 @@ -120,7 +120,7 @@ def test_caught_exception(self): def f(p): try: 1/0 - except: pass + except Exception: pass f_ident = ident(f) self.check_events(f, [(1, 'call', f_ident), (1, 'return', f_ident), @@ -129,7 +129,7 @@ def test_caught_nested_exception(self): def f(p): try: 1/0 - except: pass + except Exception: pass f_ident = ident(f) self.check_events(f, [(1, 'call', f_ident), (1, 'return', f_ident), @@ -152,9 +152,9 @@ def g(p): try: f(p) - except: + except Exception: try: f(p) - except: pass + except Exception: pass f_ident = ident(f) g_ident = ident(g) self.check_events(g, [(1, 'call', g_ident), @@ -302,7 +302,7 @@ def test_caught_exception(self): def f(p): try: 1/0 - except: pass + except Exception: pass f_ident = ident(f) self.check_events(f, [(1, 'call', f_ident), (1, 'return', f_ident), @@ -347,7 +347,7 @@ def protect(f, p): try: f(p) - except: pass + except Exception: pass protect_ident = ident(protect) diff -r 55f62fa5bebc Lib/test/test_tarfile.py --- a/Lib/test/test_tarfile.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_tarfile.py Wed Apr 16 13:51:52 2014 -0400 @@ -2040,7 +2040,7 @@ try: with tarfile.open(tmpname, "w") as tar: raise Exception - except: + except Exception: pass self.assertEqual(os.path.getsize(tmpname), 0, "context manager wrote an end-of-archive block") @@ -2061,7 +2061,7 @@ try: with tarfile.open(fileobj=fobj, mode="w") as tar: raise Exception - except: + except Exception: pass self.assertFalse(fobj.closed, "external file object was closed") self.assertTrue(tar.closed, "context manager failed") diff -r 55f62fa5bebc Lib/test/test_univnewlines.py --- a/Lib/test/test_univnewlines.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_univnewlines.py Wed Apr 16 13:51:52 2014 -0400 @@ -52,7 +52,7 @@ def tearDown(self): try: os.unlink(support.TESTFN) - except: + except Exception: pass def test_read(self): diff -r 55f62fa5bebc Lib/test/test_urllib.py --- a/Lib/test/test_urllib.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_urllib.py Wed Apr 16 13:51:52 2014 -0400 @@ -439,13 +439,13 @@ FILE.close() finally: try: FILE.close() - except: pass + except Exception: pass def tearDown(self): # Delete the temporary files. for each in self.tempFiles: try: os.remove(each) - except: pass + except Exception: pass def constructLocalFileUrl(self, filePath): filePath = os.path.abspath(filePath) @@ -468,7 +468,7 @@ newFile.close() finally: try: newFile.close() - except: pass + except Exception: pass return newFilePath def registerFileForCleanUp(self, fileName): @@ -498,7 +498,7 @@ FILE.close() finally: try: FILE.close() - except: pass + except Exception: pass self.assertEqual(self.text, text) def test_reporthook(self): diff -r 55f62fa5bebc Lib/test/test_uu.py --- a/Lib/test/test_uu.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/test/test_uu.py Wed Apr 16 13:51:52 2014 -0400 @@ -129,13 +129,13 @@ f.close() except (SystemExit, KeyboardInterrupt): raise - except: + except Exception: pass try: os.unlink(f.name) except (SystemExit, KeyboardInterrupt): raise - except: + except Exception: pass def setUp(self): diff -r 55f62fa5bebc Lib/tkinter/commondialog.py --- a/Lib/tkinter/commondialog.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/tkinter/commondialog.py Wed Apr 16 13:51:52 2014 -0400 @@ -54,7 +54,7 @@ try: # get rid of the widget w.destroy() - except: + except Exception: pass return s diff -r 55f62fa5bebc Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/tkinter/tix.py Wed Apr 16 13:51:52 2014 -0400 @@ -360,7 +360,7 @@ name = name[len(self._w)+1:] try: retlist.append(self._nametowidget(name)) - except: + except Exception: # some of the widgets are unknown e.g. border in LabelFrame pass return retlist diff -r 55f62fa5bebc Lib/turtle.py --- a/Lib/turtle.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/turtle.py Wed Apr 16 13:51:52 2014 -0400 @@ -191,7 +191,7 @@ value = float(value) else: value = int(value) - except: + except Exception: pass # value need not be converted cfgdict[key] = value return cfgdict @@ -652,7 +652,7 @@ x, y = (self.cv.canvasx(event.x)/self.xscale, -self.cv.canvasy(event.y)/self.yscale) fun(x, y) - except: + except Exception: pass self.cv.tag_bind(item, "" % num, eventfun, add) diff -r 55f62fa5bebc Lib/turtledemo/lindenmayer.py --- a/Lib/turtledemo/lindenmayer.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/turtledemo/lindenmayer.py Wed Apr 16 13:51:52 2014 -0400 @@ -42,7 +42,7 @@ except TypeError: try: draw(rules[b], rules) - except: + except Exception: pass diff -r 55f62fa5bebc Lib/uuid.py --- a/Lib/uuid.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Lib/uuid.py Wed Apr 16 13:51:52 2014 -0400 @@ -376,7 +376,7 @@ buffer = ctypes.create_string_buffer(300) ctypes.windll.kernel32.GetSystemDirectoryA(buffer, 300) dirs.insert(0, buffer.value.decode('mbcs')) - except: + except Exception: pass for dir in dirs: try: @@ -433,7 +433,7 @@ for libname in ['uuid', 'c']: try: lib = ctypes.CDLL(ctypes.util.find_library(libname)) - except: + except Exception: continue if hasattr(lib, 'uuid_generate_random'): _uuid_generate_random = lib.uuid_generate_random @@ -469,7 +469,7 @@ lib = None _UuidCreate = getattr(lib, 'UuidCreateSequential', getattr(lib, 'UuidCreate', None)) -except: +except Exception: pass def _unixdll_getnode(): @@ -513,7 +513,7 @@ for getter in getters + [_random_getnode]: try: _node = getter() - except: + except Exception: continue if _node is not None: return _node diff -r 55f62fa5bebc Mac/BuildScript/build-installer.py --- a/Mac/BuildScript/build-installer.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Mac/BuildScript/build-installer.py Wed Apr 16 13:51:52 2014 -0400 @@ -764,7 +764,7 @@ except: try: os.unlink(fname) - except: + except Exception: pass def verifyThirdPartyFile(url, checksum, fname): diff -r 55f62fa5bebc Tools/demo/ss1.py --- a/Tools/demo/ss1.py Wed Apr 16 18:56:28 2014 +0200 +++ b/Tools/demo/ss1.py Wed Apr 16 13:51:52 2014 -0400 @@ -763,7 +763,7 @@ for cls in int, float, complex: try: value = cls(text) - except: + except Exception: continue else: cell = NumericCell(value)

AltStyle によって変換されたページ (->オリジナル) /