Skip to content

Commit 13c92ad

Browse files
pipcl.py: two small fixes.
git_get(): fix parsing of 'git:...'. NewFiles: fix use of hashlib on python < 3.11.
1 parent 960257e commit 13c92ad

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pipcl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ def git_get(
20452045
tag == next(args)
20462046
branch = None
20472047
else:
2048-
remote = next(args)
2048+
remote = arg
20492049
assert remote, f'{default_remote=} and no remote specified in remote={remote0!r}.'
20502050
assert branch or tag, f'{branch=} {tag=} and no branch/tag specified in remote={remote0!r}.'
20512051

@@ -2940,7 +2940,10 @@ def get_one(self):
29402940
def _file_id(self, path):
29412941
mtime = os.stat(path).st_mtime
29422942
with open(path, 'rb') as f:
2943-
hash_ = hashlib.file_digest(f, hashlib.md5).digest()
2943+
content = f.read()
2944+
hash_ = hashlib.md5(content).digest()
2945+
# With python >= 3.11 we can do:
2946+
#hash_ = hashlib.file_digest(f, hashlib.md5).digest()
29442947
return mtime, hash_
29452948
def _items(self):
29462949
ret = dict()

0 commit comments

Comments
 (0)