Skip to content

Commit d6d83b5

Browse files
committed
Change io.open to open, since regular open in Python 3 already supports encoding
1 parent 7dcccec commit d6d83b5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

register.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import pypandoc
2-
import io
2+
from io import open
33

44
output = pypandoc.convert('README.md', 'rst')
55
with open('README.txt' 'w+') as f:
66
f.write(str(output.encode('utf-8')))
77

8-
readme_rst = io.open('./README.txt', 'r', encoding='utf-8').read()
8+
readme_rst = open('./README.txt', 'r', encoding='utf-8').read()
99
replace = '''
1010
.. figure:: https://uiux.s3.amazonaws.com/2016-logos/email-logo
1111
%402x.png\n :alt: SendGrid Logo\n\n SendGrid Logo\n
@@ -16,5 +16,5 @@
1616
\n :target: https://www.sendgrid.com
1717
'''
1818
final_text = readme_rst.replace(replace, replacement)
19-
with io.open('./README.txt', 'w', encoding='utf-8') as f:
19+
with open('./README.txt', 'w', encoding='utf-8') as f:
2020
f.write(final_text)

sendgrid/helpers/inbound/send.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Usage: ./send.py [path to file containing test data]"""
33
import argparse
44
import sys
5-
import io
5+
from io import open
66
try:
77
from config import Config
88
except ImportError:
@@ -27,7 +27,7 @@ def test_payload(self, payload_filepath):
2727
"Content-Type": "multipart/form-data; boundary=xYzZY"
2828
}
2929
client = Client(host=self.url, request_headers=headers)
30-
f = io.open(payload_filepath, 'r', encoding='utf-8')
30+
f = open(payload_filepath, 'r', encoding='utf-8')
3131
data = f.read()
3232
return client.post(request_body=data)
3333

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
import os
3-
import io
3+
from io import open
44
from setuptools import setup, find_packages
55

66
__version__ = None
@@ -9,7 +9,7 @@
99

1010
long_description = 'Please see our GitHub README'
1111
if os.path.exists('README.txt'):
12-
long_description = io.open('README.txt', 'r', encoding='utf-8').read()
12+
long_description = open('README.txt', 'r', encoding='utf-8').read()
1313

1414

1515
def getRequires():

0 commit comments

Comments
 (0)