All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Estner <michaelestner@web.de>
To: bitbake-devel@lists.openembedded.org
Cc: Michael Estner <michaelestner@web.de>
Subject: [bitbake-devel][PATCH 1/1] utils: pylint: clean up imports
Date: Mon, 17 Feb 2025 16:29:53 +0100	[thread overview]
Message-ID: <20250217152953.70557-1-michaelestner@web.de> (raw)

As mentioned in the TODO file I run pylint
and start clean code including:
Remove double imports
Order the imports as mentioned by pylint.
First small patch to see if what I do
fits the expectations.

Signed-off-by: Michael Estner <michaelestner@web.de>
---
 lib/bb/utils.py | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 135c71c00..3cb59d807 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -11,11 +11,8 @@ import re, fcntl, os, string, stat, shutil, time
 import sys
 import errno
 import logging
-import bb
-import bb.msg
 import locale
 import multiprocessing
-import fcntl
 import importlib
 import importlib.machinery
 import importlib.util
@@ -24,7 +21,6 @@ import subprocess
 import glob
 import fnmatch
 import traceback
-import errno
 import signal
 import collections
 import copy
@@ -36,6 +32,8 @@ import tempfile
 from subprocess import getstatusoutput
 from contextlib import contextmanager
 from ctypes import cdll
+import bb
+import bb.msg

 logger = logging.getLogger("BitBake.Util")
 python_extensions = importlib.machinery.all_suffixes()
@@ -1457,8 +1455,6 @@ def edit_bblayers_conf(bblayers_conf, add, remove, edit_cb=None):
             but weren't (because they weren't in the list)
     """

-    import fnmatch
-
     def remove_trailing_sep(pth):
         if pth and pth[-1] == os.sep:
             pth = pth[:-1]
@@ -1649,7 +1645,7 @@ def ioprio_set(who, cls, value):
         bb.warn("Unable to set IO Prio for arch %s" % _unamearch)

 def set_process_name(name):
-    from ctypes import cdll, byref, create_string_buffer
+    from ctypes import byref, create_string_buffer
     # This is nice to have for debugging, not essential
     try:
         libc = cdll.LoadLibrary('libc.so.6')
--
2.25.1



             reply	other threads:[~2025-02-17 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 15:29 Michael Estner [this message]
2025-02-18 23:10 ` [bitbake-devel][PATCH 1/1] utils: pylint: clean up imports Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250217152953.70557-1-michaelestner@web.de \
    --to=michaelestner@web.de \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.