From 68c596fbb99645c7de4bd5cb972671487717ccd7 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 22 May 2006 12:09:48 +0000 Subject: [PATCH] Small patch from Steven Taschuk to work around buggy dbm implementations which have non-idempotent len() functions, so that the test `if db' doesn't return the same result every time (!). By explicitly testing whether db is None rather than returning false if db is non-None but inexplicably returns zero from len(), we avoid the problem in favour of the semantics I actually intended. git-svn-id: svn://svn.tartarus.org/sgt/utils@6715 cda61777-01e9-0310-a592-d414129be87e --- cvt-utf8/cvt-utf8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvt-utf8/cvt-utf8 b/cvt-utf8/cvt-utf8 index c7c4d20..4df2f33 100755 --- a/cvt-utf8/cvt-utf8 +++ b/cvt-utf8/cvt-utf8 @@ -62,7 +62,7 @@ def hexstr(x): return s def charname(x): - if db: + if db is not None: key = hexstr(x) while len(key) < 4: key = "0" + key key = string.upper(key) -- 2.11.0