Use io.open() instead of codecs.open().

(builtins.open() is io.open() in Python 3.)
parent dc18e9ba
#!/usr/bin/env python
"""Distutils setup file, used to install or test 'setuptools'"""
import sys
import io
import os
import sys
import textwrap
import codecs
# Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
......@@ -82,7 +82,7 @@ class test(_test):
f.write(ep_content)
readme_file = codecs.open('README.txt', encoding='utf-8')
readme_file = io.open('README.txt', encoding='utf-8')
# the release script adds hyperlinks to issues
if os.path.exists('CHANGES (links).txt'):
......
# -*- coding: utf-8 -*-
"""svn tests"""
import io
import os
import subprocess
import sys
import unittest
import codecs
import subprocess
from setuptools.tests import environment
from setuptools.compat import unicode, unichr
......@@ -54,7 +53,7 @@ class TestSvnVersion(unittest.TestCase):
def _read_utf8_file(path):
fileobj = None
try:
fileobj = codecs.open(path, 'r', 'utf-8')
fileobj = io.open(path, 'r', encoding='utf-8')
data = fileobj.read()
return data
finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment