Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/common.py @ 36397:7a3590e67868
py3: use '//' for integer division in hgweb/common.py
'/' on Python 3 does the float division.
Differential Revision: https://phab.mercurial-scm.org/D2422
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 24 Feb 2018 16:20:55 +0530 |
parents | d18c0cf5f3ab |
children | f8ea6988a5fb |
comparison
equal
deleted
inserted
replaced
36396:743b293c3ca0 | 36397:7a3590e67868 |
---|---|
183 def paritygen(stripecount, offset=0): | 183 def paritygen(stripecount, offset=0): |
184 """count parity of horizontal stripes for easier reading""" | 184 """count parity of horizontal stripes for easier reading""" |
185 if stripecount and offset: | 185 if stripecount and offset: |
186 # account for offset, e.g. due to building the list in reverse | 186 # account for offset, e.g. due to building the list in reverse |
187 count = (stripecount + offset) % stripecount | 187 count = (stripecount + offset) % stripecount |
188 parity = (stripecount + offset) / stripecount & 1 | 188 parity = (stripecount + offset) // stripecount & 1 |
189 else: | 189 else: |
190 count = 0 | 190 count = 0 |
191 parity = 0 | 191 parity = 0 |
192 while True: | 192 while True: |
193 yield parity | 193 yield parity |