Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e93e477

Browse files
committed
Fiddle test_augassign so it passes under -Qnew.
1 parent f582b82 commit e93e477

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Lib/test/test_augassign.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,16 @@ def __ilshift__(self, val):
217217
1 * x
218218
x *= 1
219219

220-
x / 1
221-
1 / x
222-
x /= 1
220+
if 1/2 == 0:
221+
x / 1
222+
1 / x
223+
x /= 1
224+
else:
225+
# True division is in effect, so "/" doesn't map to __div__ etc;
226+
# but the canned expected-output file requires that those get called.
227+
x.__div__(1)
228+
x.__rdiv__(1)
229+
x.__idiv__(1)
223230

224231
x // 1
225232
1 // x

0 commit comments

Comments
 (0)