[PATCH] osutil: add darwin-only version of os.listdir using cffi

Matt Mackall mpm at selenic.com
Mon Jul 11 08:29:51 EDT 2016

On Mon, 2016-07-11 at 13:58 +0200, Maciej Fijalkowski wrote:
> There are two problems with this commit:
> a) listdir_internal has "_" in name. What would be the official naming
> convention here?

Every internal underscore in the code-base is a (usually legacy) violation of
the coding style or a concession to the horrible inconsistency of Python's
libraries. The code lags the coding style rules, so when they disagree, follow
the rules, don't go backwards.

> b) bare except - I would argue that a close() in finally totally
> warrants the bare except (this is what C code is doing implicitly)

Be explicit and catch a BaseException. This says "I know bare exceptions are
usually a bug, I have thought about it and am not just being lazy".
Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list