From 683dbd4f8b8826b326200cd5be0a39f661994cf3 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 10 Jul 2020 15:21:31 -0700 Subject: [PATCH] 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. --- test/SILGen/magic_identifier_file_conflicting.swift.gyb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/SILGen/magic_identifier_file_conflicting.swift.gyb b/test/SILGen/magic_identifier_file_conflicting.swift.gyb index 350304b90936d..d0700178c9982 100644 --- a/test/SILGen/magic_identifier_file_conflicting.swift.gyb +++ b/test/SILGen/magic_identifier_file_conflicting.swift.gyb @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %gyb -D TEMPDIR=%t %s > %t/magic_identifier_file_conflicting.swift -// 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 +// 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 // We want to check both the diagnostics and the SIL output. // 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