Skip to content

Commit cb1aeea

Browse files
committed
test: make stdlib/Integer.swift.gyb python 3 friendly
Adjust the division operation to ensure that we get an integral value back. Without this, we would attempt to shift a floating point value by bitwise operations which is not supported.
1 parent 69ff5be commit cb1aeea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/stdlib/Integers.swift.gyb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
// REQUIRES: OS=macosx
2020

2121
%{
22-
word_bits = int(WORD_BITS) / 2
22+
from __future__ import division
23+
word_bits = int(WORD_BITS) // 2
2324
from SwiftIntTypes import all_integer_types
2425
}%
2526

0 commit comments

Comments
 (0)