Skip to content

Commit

Permalink
Drop remains of Python 2 support code
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed May 3, 2020
1 parent bffd7bf commit 210b733
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
25 changes: 7 additions & 18 deletions check_manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""Check the MANIFEST.in file in a Python source package for completeness.
This script works by building a source distribution archive (by running
Expand All @@ -13,10 +13,10 @@
with stale egg-info/SOURCES.txt files that may cause files not mentioned in
MANIFEST.in to be included nevertheless.
"""
from __future__ import print_function

import argparse
import codecs
import configparser
import fnmatch
import locale
import os
Expand All @@ -33,18 +33,7 @@
from contextlib import contextmanager, closing
from distutils.filelist import translate_pattern
from distutils.text_file import TextFile

try:
from xml.etree import cElementTree as ET
except ImportError:
# Python 3.9+
from xml.etree import ElementTree as ET

try:
import ConfigParser
except ImportError:
# Python 3.x
import configparser as ConfigParser
from xml.etree import ElementTree as ET

import toml

Expand All @@ -63,7 +52,7 @@ class Failure(Exception):
# User interface
#

class UI(object):
class UI:

def __init__(self, verbosity=1):
self.verbosity = verbosity
Expand Down Expand Up @@ -382,7 +371,7 @@ def add_prefix_to_each(prefix, filelist):
return [posixpath.join(prefix, name) for name in filelist]


class VCS(object):
class VCS:

def __init__(self, ui):
self.ui = ui
Expand Down Expand Up @@ -582,7 +571,7 @@ def normalize_name(name):
# Packaging logic
#

class IgnoreList(object):
class IgnoreList:

def __init__(self):
self._regexps = []
Expand Down Expand Up @@ -731,7 +720,7 @@ def _load_config():
return config["tool"][CFG_SECTION_CHECK_MANIFEST]

search_files = ['setup.cfg', 'tox.ini']
config_parser = ConfigParser.ConfigParser()
config_parser = configparser.ConfigParser()
for filename in search_files:
if (config_parser.read([filename])
and config_parser.has_section(CFG_SECTION_CHECK_MANIFEST)):
Expand Down
7 changes: 1 addition & 6 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
import zipfile
from contextlib import closing
from functools import partial
from io import BytesIO
from io import BytesIO, StringIO
from xml.etree import ElementTree as ET

try:
from cStringIO import StringIO # Python 2.x
except ImportError:
from io import StringIO # Python 3.x

import mock

from check_manifest import rmtree
Expand Down

0 comments on commit 210b733

Please sign in to comment.