diff mbox series

[v2,04/14] patman: Drop Python 2 StringIO code

Message ID 20200417180829.v2.4.Id16180ffc276e7448ff3903b9aa78b28365d4492@changeid
State Accepted
Commit c3a13cc3331846a900f0bf6d003357d5c6b7dbe3
Headers show
Series tools: patman: Convert Python tools to use absolute imports | expand

Commit Message

Simon Glass April 18, 2020, 12:08 a.m. UTC
We can rely on Python 3 now, so drop the workaround for importing
StringIO.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2: None

 tools/patman/func_test.py | 5 +----
 tools/patman/settings.py  | 5 +----
 tools/patman/test_util.py | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

Comments

Simon Glass April 27, 2020, 3:06 a.m. UTC | #1
We can rely on Python 3 now, so drop the workaround for importing
StringIO.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2: None

 tools/patman/func_test.py | 5 +----
 tools/patman/settings.py  | 5 +----
 tools/patman/test_util.py | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 76319fff37..748e225446 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -12,10 +12,7 @@  import sys
 import tempfile
 import unittest
 
-try:
-    from StringIO import StringIO
-except ImportError:
-    from io import StringIO
+from io import StringIO
 
 import gitutil
 import patchstream
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 9ac96c485d..21e8fc41a9 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -34,10 +34,7 @@  class _ProjectConfigParser(ConfigParser.SafeConfigParser):
     - Merge general default settings/aliases with project-specific ones.
 
     # Sample config used for tests below...
-    >>> try:
-    ...     from StringIO import StringIO
-    ... except ImportError:
-    ...     from io import StringIO
+    >>> from io import StringIO
     >>> sample_config = '''
     ... [alias]
     ... me: Peter P. <likesspiders at example.com>
diff --git a/tools/patman/test_util.py b/tools/patman/test_util.py
index 4338dbcd28..4d0085e2ed 100644
--- a/tools/patman/test_util.py
+++ b/tools/patman/test_util.py
@@ -10,10 +10,7 @@  import sys
 
 import command
 
-try:
-  from StringIO import StringIO
-except ImportError:
-  from io import StringIO
+from io import StringIO
 
 PYTHON = 'python%d' % sys.version_info[0]