From bcfa7cb99bff9a740b4932db06fa515127bb1906 Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 24 Oct 2025 18:02:19 +0200 Subject: [PATCH] Minor code enhancements --- npbackup/configuration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npbackup/configuration.py b/npbackup/configuration.py index dbbc1c9..e0aa580 100644 --- a/npbackup/configuration.py +++ b/npbackup/configuration.py @@ -701,10 +701,10 @@ def get_repo_config( _config_inheritance.g(key)[v] = False else: # repo_config may or may not already contain data - if _repo_config is None or _repo_config == "": + if _repo_config in [None, ""]: _repo_config = CommentedMap() _config_inheritance = CommentedMap() - if _repo_config.g(key) is None or _repo_config.g(key) == "": + if _repo_config.g(key) in [None, ""]: _repo_config.s(key, value) _config_inheritance.s(key, True) # Case where repo_config contains list but group info has single str @@ -832,7 +832,7 @@ def _get_config_file_checksum(config_file: Path) -> str: cur_hash = 0 while True: s = fh.read(65536) - if not s: + if len(s) == 0: break cur_hash = zlib.crc32(s, cur_hash) return "%08X" % (cur_hash & 0xFFFFFFFF)