aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-17 06:30:35 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-17 06:39:01 +0200
commit323df713a741440795c565ee2d79de0beb22b722 (patch)
tree6133e2d6db7b2e602cd90e5a363fa9109e515113
parentClean up more py2 conditional code (diff)
downloadportage-323df713a741440795c565ee2d79de0beb22b722.tar.gz
portage-323df713a741440795c565ee2d79de0beb22b722.tar.bz2
portage-323df713a741440795c565ee2d79de0beb22b722.zip
Remove support code for Python < 3.2
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--lib/portage/tests/process/test_poll.py9
-rw-r--r--lib/portage/tests/util/futures/asyncio/test_pipe_closed.py7
-rw-r--r--lib/portage/util/configparser.py13
3 files changed, 8 insertions, 21 deletions
diff --git a/lib/portage/tests/process/test_poll.py b/lib/portage/tests/process/test_poll.py
index f505b5049..3ea176c0d 100644
--- a/lib/portage/tests/process/test_poll.py
+++ b/lib/portage/tests/process/test_poll.py
@@ -1,4 +1,4 @@
-# Copyright 1998-2019 Gentoo Authors
+# Copyright 1998-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import functools
@@ -34,11 +34,8 @@ class PipeReaderTestCase(TestCase):
def test_domain_socket(self):
def make_pipes():
- if sys.version_info >= (3, 2):
- read_end, write_end = socket.socketpair()
- return (read_end.detach(), write_end.detach()), None
- else:
- self.skipTest('socket detach not supported')
+ read_end, write_end = socket.socketpair()
+ return (read_end.detach(), write_end.detach()), None
self._do_test(make_pipes)
def test_named_pipe(self):
diff --git a/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py b/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
index 507385c04..b8e5556d0 100644
--- a/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
+++ b/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
@@ -1,4 +1,4 @@
-# Copyright 2018 Gentoo Foundation
+# Copyright 2018-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import errno
@@ -32,10 +32,7 @@ class _PipeClosedTestCase(object):
self._do_test(read_end, write_end)
def test_domain_socket(self):
- if sys.version_info >= (3, 2):
- read_end, write_end = socket.socketpair()
- else:
- self.skipTest('socket detach not supported')
+ read_end, write_end = socket.socketpair()
self._do_test(read_end.detach(), write_end.detach())
def test_named_pipe(self):
diff --git a/lib/portage/util/configparser.py b/lib/portage/util/configparser.py
index f3452231f..9bd9f9722 100644
--- a/lib/portage/util/configparser.py
+++ b/lib/portage/util/configparser.py
@@ -11,16 +11,9 @@ __all__ = ['ConfigParserError', 'NoOptionError', 'ParsingError',
import io
import sys
-try:
- from configparser import (Error as ConfigParserError,
- NoOptionError, ParsingError, RawConfigParser)
- if sys.hexversion >= 0x3020000:
- from configparser import ConfigParser as SafeConfigParser
- else:
- from configparser import SafeConfigParser
-except ImportError:
- from ConfigParser import (Error as ConfigParserError,
- NoOptionError, ParsingError, RawConfigParser, SafeConfigParser)
+from configparser import (Error as ConfigParserError,
+ NoOptionError, ParsingError, RawConfigParser)
+from configparser import ConfigParser as SafeConfigParser
from portage import _encodings
from portage import _unicode_encode