[Python-checkins] Fix DeprecationWarning in test_bytes (GH-10805)

Victor Stinner webhook-mailer at python.org
Fri Nov 30 05:04:49 EST 2018


https://github.com/python/cpython/commit/d7a880c3c2b73415a42c8a2f900c6bc597de115d
commit: d7a880c3c2b73415a42c8a2f900c6bc597de115d
branch: 2.7
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-11-30T11:04:42+01:00
summary:

Fix DeprecationWarning in test_bytes (GH-10805)

Running test_bytes with python -3 -Wd emits two DeprecationWarning on
"1/0". Use "1//0" to prevent the warning.

files:
M Lib/test/test_bytes.py

diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index c04f7b305a0a..cb2a4d95787d 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -161,13 +161,13 @@ def test_constructor_exceptions(self):
         # 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):



More information about the Python-checkins mailing list