The 'str' object never has attribute decode in Python3, so remove the dead code.

This commit is contained in:
Cyril Jouve
2020-08-12 18:55:35 +05:30
committed by Akshay Joshi
parent 26506a9727
commit 36574b25b6
9 changed files with 20 additions and 148 deletions

View File

@@ -68,12 +68,7 @@ class ManagedSession(CallbackDict, SessionMixin):
def sign(self, secret):
if not self.hmac_digest:
if hasattr(string, 'lowercase'):
population = string.lowercase
# If script is running under python3
elif hasattr(string, 'ascii_lowercase'):
population = string.ascii_lowercase
population += string.digits
population = string.ascii_lowercase + string.digits
self.randval = ''.join(random.sample(population, 20))
self.hmac_digest = _calc_hmac(