]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix DeprecationWarning in test_bytes (GH-10805)
authorVictor Stinner <vstinner@redhat.com>
Fri, 30 Nov 2018 10:04:42 +0000 (11:04 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Nov 2018 10:04:42 +0000 (11:04 +0100)
Running test_bytes with python -3 -Wd emits two DeprecationWarning on
"1/0". Use "1//0" to prevent the warning.

Lib/test/test_bytes.py

index c04f7b305a0a67672ea3c93e1df145164c7fcd68..cb2a4d95787d621632b201de11acf3443cca07ce 100644 (file)
@@ -161,13 +161,13 @@ class BaseBytesTest(unittest.TestCase):
         # exceptions.
         class BadInt:
             def __index__(self):
-                1/0
+                1//0
         self.assertRaises(ZeroDivisionError, self.type2test, BadInt())
         self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()])
 
         class BadIterable:
             def __iter__(self):
-                1/0
+                1//0
         self.assertRaises(ZeroDivisionError, self.type2test, BadIterable())
 
     def test_compare(self):