From c0c4f4f56e9bdd5c202df3655dfad4c34ca26f63 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 17 Aug 2025 14:32:55 +0200 Subject: [PATCH] removed support for multiple interpreters --- __init__.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/__init__.py b/__init__.py index 21e270a..82a2500 100644 --- a/__init__.py +++ b/__init__.py @@ -38,7 +38,6 @@ import hmac import logging import os from functools import partial -import sys import time @@ -58,8 +57,6 @@ except ImportError: __DESCRIPTION__ = """The Module {\\tt %s} is designed to help on all issues with files and folders. For more Information read the documentation.""" % __name__.replace('_', '\\_') """The Module Description""" -__INTERPRETER__ = (3, ) -"""The Tested Interpreter-Versions""" def dirlist(path='.', expression='*', rekursive=True): @@ -277,12 +274,8 @@ def uid(path, max_staleness=3600): fake_mtime) # trick to workaround file system / platform # limitations causing permanent trouble ) - if sys.version_info < (3, 0): - secret = '' - return hmac.new(secret, repr(uid), hashlib.sha1).hexdigest() - else: - secret = b'' - return hmac.new(secret, bytes(repr(uid), 'latin-1'), hashlib.sha1).hexdigest() + secret = b'' + return hmac.new(secret, bytes(repr(uid), 'latin-1'), hashlib.sha1).hexdigest() def uid_filelist(path='.', expression='*', rekursive=True): @@ -309,14 +302,10 @@ def uid_filelist(path='.', expression='*', rekursive=True): fl = filelist(path, expression, rekursive) fl.sort() for f in fl: - if sys.version_info < (3, 0): - with open(f, 'rb') as fh: - SHAhash.update(hashlib.md5(fh.read()).hexdigest()) - else: - with open(f, mode='rb') as fh: - d = hashlib.md5() - for buf in iter(partial(fh.read, 128), b''): - d.update(buf) - SHAhash.update(d.hexdigest().encode()) + with open(f, mode='rb') as fh: + d = hashlib.md5() + for buf in iter(partial(fh.read, 128), b''): + d.update(buf) + SHAhash.update(d.hexdigest().encode()) # return SHAhash.hexdigest()