Patchwork D2422: py3: use '//' for integer division in hgweb/common.py

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2018, 11:19 a.m.
Message ID <differential-rev-PHID-DREV-bvyv2xmfp7tobgpk4k7d-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28320/
State Superseded
Headers show

Comments

phabricator - Feb. 24, 2018, 11:19 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  '/' on Python 3 does the float division.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2422

AFFECTED FILES
  mercurial/hgweb/common.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -185,7 +185,7 @@ 
     if stripecount and offset:
         # account for offset, e.g. due to building the list in reverse
         count = (stripecount + offset) % stripecount
-        parity = (stripecount + offset) / stripecount & 1
+        parity = (stripecount + offset) // stripecount & 1
     else:
         count = 0
         parity = 0