]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833)
authorVictor Stinner <vstinner@redhat.com>
Fri, 30 Nov 2018 19:45:04 +0000 (20:45 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Nov 2018 19:45:04 +0000 (20:45 +0100)
Fix DeprecationWarning when tests are run using python -3.

Lib/test/test_bdb.py
Lib/test/test_gdb.py
Lib/test/test_sys_settrace.py

index 4fb7c79cdcc510859f2f224277b56e5d11f3e02c..d3ff8fc76860c40838a05e561b8e57c5448193fc 100644 (file)
@@ -868,7 +868,7 @@ class BreakpointTestCase(BaseTestCase):
         with create_modules(modules):
             self.expect_set = [
                 ('line', 2, 'tfunc_import'),
-                    break_in_func('func', TEST_MODULE_FNAME, False, '1 / 0'),
+                    break_in_func('func', TEST_MODULE_FNAME, False, '1 // 0'),
                 ('None', 2, 'tfunc_import'),       ('continue', ),
                 ('line', 3, 'func', ({1:1}, [])),  ('quit', ),
             ]
index 118dbbf0d9ef269e878dd2818dc90b37f9656618..335e48a24e6832ef706cfceb8e238fbc9f384132 100644 (file)
@@ -423,7 +423,7 @@ except RuntimeError, e:
         # Test division by zero:
         gdb_repr, gdb_output = self.get_gdb_repr('''
 try:
-    a = 1 / 0
+    a = 1 // 0
 except ZeroDivisionError, e:
     print e
 ''')
index d8737af3bc8d6c174dd40c8357ed7f92633fe495..b6695fe012f8f8764ce51f4cf176351d56146b3c 100644 (file)
@@ -1053,7 +1053,7 @@ output.append(4)
                "can only jump from a 'line' trace event"))
     def test_no_jump_from_exception_event(output):
         output.append(1)
-        1 / 0
+        1 // 0
 
     @jump_test(3, 2, [2], event='return', error=(ValueError,
                "can't jump from a yield statement"))