codecs.open / io.open

This commit is contained in:
Anthony Sottile 2019-06-02 15:41:48 -07:00 committed by Bruno Oliveira
parent 4df529e5b9
commit c63320cc31
2 changed files with 4 additions and 6 deletions

View File

@ -1,5 +1,4 @@
"""(disabled by default) support for testing pytest and pytest plugins.""" """(disabled by default) support for testing pytest and pytest plugins."""
import codecs
import gc import gc
import os import os
import platform import platform
@ -1089,8 +1088,8 @@ class Testdir:
p2 = self.tmpdir.join("stderr") p2 = self.tmpdir.join("stderr")
print("running:", *cmdargs) print("running:", *cmdargs)
print(" in:", py.path.local()) print(" in:", py.path.local())
f1 = codecs.open(str(p1), "w", encoding="utf8") f1 = open(str(p1), "w", encoding="utf8")
f2 = codecs.open(str(p2), "w", encoding="utf8") f2 = open(str(p2), "w", encoding="utf8")
try: try:
now = time.time() now = time.time()
popen = self.popen( popen = self.popen(
@ -1125,8 +1124,8 @@ class Testdir:
finally: finally:
f1.close() f1.close()
f2.close() f2.close()
f1 = codecs.open(str(p1), "r", encoding="utf8") f1 = open(str(p1), "r", encoding="utf8")
f2 = codecs.open(str(p2), "r", encoding="utf8") f2 = open(str(p2), "r", encoding="utf8")
try: try:
out = f1.read().splitlines() out = f1.read().splitlines()
err = f2.read().splitlines() err = f2.read().splitlines()

View File

@ -1,6 +1,5 @@
import os import os
import re import re
from io import open
import six import six