mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
#7092: silence some py3k warnings
This commit is contained in:
parent
a7f242fa2a
commit
dfd3618422
4 changed files with 6 additions and 6 deletions
|
@ -1194,7 +1194,7 @@ class EditorWindow(object):
|
||||||
if not self.context_use_ps1:
|
if not self.context_use_ps1:
|
||||||
for context in self.num_context_lines:
|
for context in self.num_context_lines:
|
||||||
startat = max(lno - context, 1)
|
startat = max(lno - context, 1)
|
||||||
startatindex = `startat` + ".0"
|
startatindex = repr(startat) + ".0"
|
||||||
rawtext = text.get(startatindex, "insert")
|
rawtext = text.get(startatindex, "insert")
|
||||||
y.set_str(rawtext)
|
y.set_str(rawtext)
|
||||||
bod = y.find_good_parse_start(
|
bod = y.find_good_parse_start(
|
||||||
|
|
|
@ -31,7 +31,7 @@ class HyperParser:
|
||||||
if not editwin.context_use_ps1:
|
if not editwin.context_use_ps1:
|
||||||
for context in editwin.num_context_lines:
|
for context in editwin.num_context_lines:
|
||||||
startat = max(lno - context, 1)
|
startat = max(lno - context, 1)
|
||||||
startatindex = `startat` + ".0"
|
startatindex = repr(startat) + ".0"
|
||||||
stopatindex = "%d.end" % lno
|
stopatindex = "%d.end" % lno
|
||||||
# We add the newline because PyParse requires a newline at end.
|
# We add the newline because PyParse requires a newline at end.
|
||||||
# We add a space so that index won't be at end of line, so that
|
# We add a space so that index won't be at end of line, so that
|
||||||
|
|
|
@ -72,11 +72,11 @@ class InternalFunctionsTest(unittest.TestCase):
|
||||||
{'-option': '{one two} three'})
|
{'-option': '{one two} three'})
|
||||||
|
|
||||||
# ignore an option
|
# ignore an option
|
||||||
amount_opts = len(ttk._format_optdict(opts, ignore=(u'á'))) / 2
|
amount_opts = len(ttk._format_optdict(opts, ignore=(u'á'))) // 2
|
||||||
self.assertEqual(amount_opts, len(opts) - 1)
|
self.assertEqual(amount_opts, len(opts) - 1)
|
||||||
|
|
||||||
# ignore non-existing options
|
# ignore non-existing options
|
||||||
amount_opts = len(ttk._format_optdict(opts, ignore=(u'á', 'b'))) / 2
|
amount_opts = len(ttk._format_optdict(opts, ignore=(u'á', 'b'))) // 2
|
||||||
self.assertEqual(amount_opts, len(opts) - 1)
|
self.assertEqual(amount_opts, len(opts) - 1)
|
||||||
|
|
||||||
# ignore every option
|
# ignore every option
|
||||||
|
|
|
@ -301,11 +301,11 @@ class BZ2FileTest(BaseTest):
|
||||||
self.fail("__enter__ on a closed file didn't raise an exception")
|
self.fail("__enter__ on a closed file didn't raise an exception")
|
||||||
try:
|
try:
|
||||||
with BZ2File(self.filename, "wb") as f:
|
with BZ2File(self.filename, "wb") as f:
|
||||||
1/0
|
1 // 0
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.fail("1/0 didn't raise an exception")
|
self.fail("1 // 0 didn't raise an exception")
|
||||||
|
|
||||||
def testThreading(self):
|
def testThreading(self):
|
||||||
# Using a BZ2File from several threads doesn't deadlock (issue #7205).
|
# Using a BZ2File from several threads doesn't deadlock (issue #7205).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue