py3: use real division operator

"/" operator using integers as both left-hand and right-hand
expressions returns floor division in python2 and real
division in python3.

Use "//" instead to do real division for both python versions.

Story: 2006796
Task: 42817

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Id8ac605d0184e70aa92717d8d3ce97bf8b7922cf
This commit is contained in:
Charles Short 2021-07-12 14:18:03 -04:00
parent 5bea936d0e
commit bcf4a4915f

View File

@ -59,7 +59,7 @@ class ParsableErrorMiddleware(object):
'status %s' % status
))
else:
if (state['status_code'] / 100) not in (2, 3):
if (state['status_code'] // 100) not in (2, 3):
# Remove some headers so we can replace them later
# when we have the full error message and can
# compute the length.
@ -72,7 +72,7 @@ class ParsableErrorMiddleware(object):
return start_response(status, headers, exc_info)
app_iter = self.app(environ, replacement_start_response)
if (state['status_code'] / 100) not in (2, 3):
if (state['status_code'] // 100) not in (2, 3):
req = webob.Request(environ)
if (req.accept.best_match(
['application/json', 'application/xml']) ==