From: Stephen Gran Date: Fri, 26 Aug 2011 19:26:15 +0000 (+0000) Subject: why does python not believe in variable scoping, but then complain about it? X-Git-Tag: userdir-ldap-0.3.85~91 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=4da58c2caaf11463d5dd477308f619fffda9acd9 why does python not believe in variable scoping, but then complain about it? Signed-off-by: Stephen Gran --- diff --git a/ud-generate b/ud-generate index 70c6efa..d3da309 100755 --- a/ud-generate +++ b/ud-generate @@ -1242,6 +1242,7 @@ for x in attrs: if x[1].has_key("subGroup") != 0: SubGroupMap.setdefault(x[1]["gid"][0], []).extend(x[1]["subGroup"]) +lock = None try: lockf = os.path.join(GenerateDir, 'ud-generate.lock') lock = get_lock( lockf ) @@ -1252,7 +1253,7 @@ try: generate_all(GenerateDir, l) finally: - if not lock is None: + if lock is not None: lock.release() # vim:set et: