From 2f693c47f9597f3b7071c7370c44a2850bce5a60 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 16 Jul 2020 14:37:26 -0400 Subject: [PATCH] Don't leak variable on Python 2. --- src/allmydata/util/base32.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/allmydata/util/base32.py b/src/allmydata/util/base32.py index f47960b87..cb21d1a8a 100644 --- a/src/allmydata/util/base32.py +++ b/src/allmydata/util/base32.py @@ -94,7 +94,9 @@ NUM_OS_TO_NUM_QS=(0, 2, 4, 5, 7,) NUM_QS_TO_NUM_OS=(0, 1, 1, 2, 2, 3, 3, 4) NUM_QS_LEGIT=(1, 0, 1, 0, 1, 1, 0, 1,) -NUM_QS_TO_NUM_BITS=tuple([x*8 for x in NUM_QS_TO_NUM_OS]) +NUM_QS_TO_NUM_BITS=tuple([_x*8 for _x in NUM_QS_TO_NUM_OS]) +if PY2: + del _x # A fast way to determine whether a given string *could* be base-32 encoded data, assuming that the # original data had 8K bits for a positive integer K.