File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ def clean(self) -> None:
419419 f .unlink ()
420420
421421 def create_hash (self , include_md :bool = True ) -> str :
422+ # sourcery skip: reintroduce-else, swap-if-else-branches, use-named-expression
422423 """
423424 Create a SHA1 hash of all files in the package, excluding the pyproject.toml file itself.
424425 the hash is based on the content of the .py/.pyi and .md files in the package.
@@ -442,11 +443,11 @@ def create_hash(self, include_md:bool=True) -> str:
442443 for file in sorted (files ):
443444 with open (file , "rb" ) as f :
444445 while True :
445- if data := f .read (BUF_SIZE ):
446- pkg_hash .update (data )
447-
448- else :
446+ data = f .read (BUF_SIZE )
447+ if not data :
449448 break
449+ pkg_hash .update (data )
450+
450451 return pkg_hash .hexdigest ()
451452
452453 def update_hashes (self ) -> None :
You can’t perform that action at this time.
0 commit comments