diff --git a/register.py b/register.py index 4eb612387..b71341a34 100644 --- a/register.py +++ b/register.py @@ -1,11 +1,11 @@ import pypandoc -import io +from io import open output = pypandoc.convert('README.md', 'rst') with open('README.txt' 'w+') as f: f.write(str(output.encode('utf-8'))) -readme_rst = io.open('./README.txt', 'r', encoding='utf-8').read() +readme_rst = open('./README.txt', 'r', encoding='utf-8').read() replace = ''' .. figure:: https://uiux.s3.amazonaws.com/2016-logos/email-logo %402x.png\n :alt: SendGrid Logo\n\n SendGrid Logo\n @@ -16,5 +16,5 @@ \n :target: https://www.sendgrid.com ''' final_text = readme_rst.replace(replace, replacement) -with io.open('./README.txt', 'w', encoding='utf-8') as f: +with open('./README.txt', 'w', encoding='utf-8') as f: f.write(final_text) diff --git a/sendgrid/helpers/inbound/send.py b/sendgrid/helpers/inbound/send.py index a7bbe01b8..053764cbb 100644 --- a/sendgrid/helpers/inbound/send.py +++ b/sendgrid/helpers/inbound/send.py @@ -2,7 +2,7 @@ Usage: ./send.py [path to file containing test data]""" import argparse import sys -import io +from io import open try: from config import Config except ImportError: @@ -27,7 +27,7 @@ def test_payload(self, payload_filepath): "Content-Type": "multipart/form-data; boundary=xYzZY" } client = Client(host=self.url, request_headers=headers) - f = io.open(payload_filepath, 'r', encoding='utf-8') + f = open(payload_filepath, 'r', encoding='utf-8') data = f.read() return client.post(request_body=data) diff --git a/setup.py b/setup.py index 8826acb0c..014691b61 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import sys import os -import io +from io import open from setuptools import setup, find_packages __version__ = None @@ -9,7 +9,7 @@ long_description = 'Please see our GitHub README' if os.path.exists('README.txt'): - long_description = io.open('README.txt', 'r', encoding='utf-8').read() + long_description = open('README.txt', 'r', encoding='utf-8').read() def getRequires():