Drop Python 2 support from Travis and setup (#405)

This commit is contained in:
Inada Naoki
2019-11-28 21:21:35 +09:00
committed by GitHub
parent 0482702d07
commit 5811678dea
5 changed files with 10 additions and 27 deletions

View File

@ -1,9 +1,4 @@
try:
# Python 2.x
from ConfigParser import SafeConfigParser
except ImportError:
# Python 3.x
from configparser import ConfigParser as SafeConfigParser
from configparser import ConfigParser as SafeConfigParser
def get_metadata_and_options():
config = SafeConfigParser()
@ -28,10 +23,9 @@ def enabled(options, option):
raise ValueError("Unknown value %s for option %s" % (value, option))
def create_release_file(metadata):
rel = open("MySQLdb/release.py",'w')
rel.write("""
with open("MySQLdb/release.py",'w') as rel:
rel.write("""
__author__ = "%(author)s <%(author_email)s>"
version_info = %(version_info)s
__version__ = "%(version)s"
""" % metadata)
rel.close()