Fix flakes on Python 3.

This commit is contained in:
Itamar Turner-Trauring 2021-05-07 09:36:01 -04:00
parent e76aa27320
commit d25140b847
4 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,9 @@ from future.utils import PY3
if PY3:
raise RuntimeError("Just use subprocess.Popen")
# This is necessary to pacify flake8 on Python 3, while we're still supporting
# Python 2.
from past.builtins import unicode
# -*- coding: utf-8 -*-

View File

@ -660,7 +660,6 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
if line]
except ValueError:
print("response is:", res)
print("undecodeable line was '%s'" % line)
raise
self.failUnlessReallyEqual(len(units), 5+1)
# should be parent-first

View File

@ -16,7 +16,7 @@ if PY2:
# Don't import bytes or str, to prevent future's newbytes leaking and
# breaking code that only expects normal bytes.
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, dict, list, object, range, max, min # noqa: F401
str = unicode
from past.builtins import unicode as str
from past.builtins import unicode, long

View File

@ -32,7 +32,7 @@ def get_registry_setting(key, name, _topkey=None):
regkey = winreg.OpenKey(topkey, key)
sublen, vallen, timestamp = winreg.QueryInfoKey(regkey)
for validx in xrange(vallen):
for validx in range(vallen):
keyname, value, keytype = winreg.EnumValue(regkey, validx)
if keyname == name and keytype == winreg.REG_SZ:
return value