git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] merge-recursive: Replace 'except:'

From
Fredrik Kuivinen <freku045@student.liu.se>
Date
Nov 20, 2005, 12:14 UTC
Message-ID
<20051120121437.GD4946@c165.ib.student.liu.se>

Plain except:s are evil as they will catch all kinds of exceptions including NameError and AttrubiteError.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
---
 git-merge-recursive.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applies-to: c037ce1b974c7d0671312b52ed46ed405c1a8443 e90840aaf9adb880297d98e16031665b426e3987

diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index 52e2ad7..3e7758d 100755
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -243,7 +243,7 @@ def updateFileExt(sha, mode, path, updat
 
             try:
                 createDir = not stat.S_ISDIR(os.lstat(p).st_mode)
-            except: 
+            except OSError:
                 createDir = True
             
             if createDir:
---
0.99.9.GIT
Message 1 of 1 in “merge-recursive: Replace 'except:'”
  1. merge-recursive: Replace 'except:'Fredrik Kuivinen, Nov 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.