[PATCH 1/3] Remove support code for Python < 3.2

Michał Górny <[email protected]>
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
Signed-off-by: Michał Górny <[email protected]>
---
 lib/portage/tests/process/test_poll.py              |  9 +++------
 .../tests/util/futures/asyncio/test_pipe_closed.py  |  7 ++-----
 lib/portage/util/configparser.py                    | 13 +++----------
 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
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.