Skip to content

Commit 683dbd4

Browse files
committed
test: adjust SILGen/magic_identifier_file_conflicting.swift.gyb for python 3
This test has inline python which requires byte-to-text conversions. Avoid that by using the `io` module.
1 parent bf5698f commit 683dbd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/SILGen/magic_identifier_file_conflicting.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %gyb -D TEMPDIR=%t %s > %t/magic_identifier_file_conflicting.swift
3-
// RUN: %{python} -c "import sys; t = open(sys.argv[1], 'rb').read().replace('\r\n', '\n'); open(sys.argv[1], 'wb').write(t)" %t/magic_identifier_file_conflicting.swift
3+
// RUN: %{python} -c "import io; import sys; t = io.open(sys.argv[1], 'r', encoding='utf-8').read().replace('\r\n', '\n'); io.open(sys.argv[1], 'w', encoding='utf-8', newline='\n').write(t)" %t/magic_identifier_file_conflicting.swift
44

55
// We want to check both the diagnostics and the SIL output.
66
// RUN: %target-swift-emit-silgen -verify -emit-sorted-sil -enable-experimental-concise-pound-file -module-name Foo %t/magic_identifier_file_conflicting.swift %S/Inputs/magic_identifier_file_conflicting_other.swift | %FileCheck %s

0 commit comments

Comments
 (0)