From 3119c329414cdfb6402927f0d55fc140bff46ccb Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Sat, 17 Feb 2024 15:14:34 +0100 Subject: [PATCH] remove Python2 comptability code --- configargparse.py | 7 ++----- tests/test_configargparse.py | 6 +----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/configargparse.py b/configargparse.py index 33a2ccf..ada70d4 100644 --- a/configargparse.py +++ b/configargparse.py @@ -14,12 +14,9 @@ import sys import types from collections import OrderedDict -import textwrap +from io import StringIO -if sys.version_info >= (3, 0): - from io import StringIO -else: - from StringIO import StringIO +import textwrap ACTION_TYPES_THAT_DONT_NEED_A_VALUE = [argparse._StoreTrueAction, diff --git a/tests/test_configargparse.py b/tests/test_configargparse.py index 288e082..da44e72 100644 --- a/tests/test_configargparse.py +++ b/tests/test_configargparse.py @@ -8,17 +8,13 @@ import tempfile import types import unittest +from io import StringIO try: import mock except ImportError: from unittest import mock -if sys.version_info >= (3, 0): - from io import StringIO -else: - from StringIO import StringIO - if sys.version_info >= (3, 10): OPTIONAL_ARGS_STRING="options" else: