Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] utils/check-package: drop six usage
@ 2023-04-03  1:35 Vincent Fazio
  2023-04-07 17:10 ` James Knight
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vincent Fazio @ 2023-04-03  1:35 UTC (permalink / raw)
  To: buildroot; +Cc: Vincent Fazio, Ricardo Martincoski

The shebang in check-package now defines python3. There is no longer a
need to maintain support with python 2.x.

See-also: 02b165dc71 (check-package: fix Python3 support)

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
---
 utils/check-package | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/utils/check-package b/utils/check-package
index 98a25bd0b2..46f2897b51 100755
--- a/utils/check-package
+++ b/utils/check-package
@@ -6,7 +6,6 @@ import inspect
 import magic
 import os
 import re
-import six
 import sys
 
 import checkpackagelib.base
@@ -218,12 +217,9 @@ def check_file_using_lib(fname):
         if fail > 0:
             failed.add(name)
         nwarnings += warn
-    if six.PY3:
-        f = open(fname, "r", errors="surrogateescape")
-    else:
-        f = open(fname, "r")
+
     lastline = ""
-    for lineno, text in enumerate(f.readlines()):
+    for lineno, text in enumerate(open(fname, "r", errors="surrogateescape").readlines()):
         nlines += 1
         for name, cf in objects:
             if cf.disable.search(lastline):
@@ -233,7 +229,7 @@ def check_file_using_lib(fname):
                 failed.add(name)
             nwarnings += warn
         lastline = text
-    f.close()
+
     for name, cf in objects:
         warn, fail = print_warnings(cf.after(), name in xfail)
         if fail > 0:
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-22 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03  1:35 [Buildroot] [PATCH] utils/check-package: drop six usage Vincent Fazio
2023-04-07 17:10 ` James Knight
2023-04-10 17:44 ` Yann E. MORIN
2023-04-10 19:11   ` Arnout Vandecappelle
2023-04-10 19:04 ` Yann E. MORIN
2023-04-22 21:10 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox