This is an archive of the discontinued Mercurial Phabricator instance.

py3: use node.hex(m.digest()) instead of m.hexdigest()
ClosedPublic

Authored by pulkit on Nov 19 2018, 1:14 PM.

Details

Summary

hashlib.sha1.hexdigest() returns str on Python 3.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Nov 19 2018, 1:14 PM
yuja added a subscriber: yuja.Nov 20 2018, 7:22 AM

diff --git a/hgext/remotefilelog/basepack.py b/hgext/remotefilelog/basepack.py

  • a/hgext/remotefilelog/basepack.py

+++ b/hgext/remotefilelog/basepack.py
@@ -10,6 +10,7 @@
from mercurial.i18n import _
from mercurial import (
+ node,

hgext/remotefilelog/basepack.py:472: import 'node' from line 12 shadowed by loop variable

pulkit updated this revision to Diff 12574.Nov 20 2018, 11:54 AM
In D5287#78759, @yuja wrote:

diff --git a/hgext/remotefilelog/basepack.py b/hgext/remotefilelog/basepack.py

  • a/hgext/remotefilelog/basepack.py

+++ b/hgext/remotefilelog/basepack.py
@@ -10,6 +10,7 @@
from mercurial.i18n import _
from mercurial import (
+ node,

hgext/remotefilelog/basepack.py:472: import 'node' from line 12 shadowed by loop variable

Looks like a False positive/negative.

yuja added a comment.Nov 21 2018, 7:41 AM
> hgext/remotefilelog/basepack.py:472: import 'node' from line 12 shadowed by loop variable
Looks like a False positive/negative.

Might be, but it's better to not shadow global names by local ones.

Queued, thanks.

This revision was automatically updated to reflect the committed changes.