All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss@m4x.org>
To: selinux@tycho.nsa.gov
Subject: [PATCH 02/13] python/sepolgen: do not import twice the modules
Date: Sat,  4 Aug 2018 21:47:23 +0200	[thread overview]
Message-ID: <20180804194734.12577-3-nicolas.iooss@m4x.org> (raw)
In-Reply-To: <20180804194734.12577-1-nicolas.iooss@m4x.org>

util.py starts by importing "locale" and "sys", so there is no need to
import these modules again in the functions.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 python/sepolgen/src/sepolgen/util.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/python/sepolgen/src/sepolgen/util.py b/python/sepolgen/src/sepolgen/util.py
index 1fca9717c05a..5d38bce29827 100644
--- a/python/sepolgen/src/sepolgen/util.py
+++ b/python/sepolgen/src/sepolgen/util.py
@@ -90,7 +90,6 @@ def first(s, sorted=False):
             return x
 
 def encode_input(text):
-    import locale
     """Encode given text via preferred system encoding"""
     # locale will often find out the correct encoding
     encoding = locale.getpreferredencoding()
@@ -104,7 +103,6 @@ def encode_input(text):
     return encoded_text
 
 def decode_input(text):
-    import locale
     """Decode given text via preferred system encoding"""
     # locale will often find out the correct encoding
     encoding = locale.getpreferredencoding()
@@ -172,11 +170,9 @@ def cmp(first, second):
     return (first > second) - (second > first)
 
 if __name__ == "__main__":
-    import sys
     import time
     p = ConsoleProgressBar(sys.stdout, steps=999)
     p.start("computing pi")
     for i in range(999):
         p.step()
         time.sleep(0.001)
-
-- 
2.18.0

  parent reply	other threads:[~2018-08-04 19:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04 19:47 [PATCH 00/13] Fix some issues found by flake8 Nicolas Iooss
2018-08-04 19:47 ` [PATCH 01/13] libselinux: fix flake8 warnings in SWIG-generated code Nicolas Iooss
2018-08-04 19:47 ` Nicolas Iooss [this message]
2018-08-04 19:47 ` [PATCH 03/13] python/sepolgen: return NotImplemented instead of raising it Nicolas Iooss
2018-08-04 19:47 ` [PATCH 04/13] python/sepolicy: drop unused CheckPolicyType Nicolas Iooss
2018-08-04 19:47 ` [PATCH 05/13] python/sepolicy: use lowercase variable name Nicolas Iooss
2018-08-04 19:47 ` [PATCH 06/13] python/sepolgen: fix refpolicy parsing of "permissive" Nicolas Iooss
2018-08-04 19:47 ` [PATCH 07/13] python/sepolgen: silence linter warning about has_key Nicolas Iooss
2018-08-04 19:47 ` [PATCH 08/13] python/sepolgen: comment buggy code Nicolas Iooss
2018-08-04 19:47 ` [PATCH 09/13] python/sepolgen: use self when accessing members in FilesystemUse Nicolas Iooss
2018-08-04 19:47 ` [PATCH 10/13] python/sepolicy: fix "procotol" misspelling Nicolas Iooss
2018-08-04 19:47 ` [PATCH 11/13] python/sepolicy: use variables which exists in the gui.py Nicolas Iooss
2018-08-04 19:47 ` [PATCH 12/13] python/sepolicy: do not import sepolicy.generate.DAEMON twice Nicolas Iooss
2018-08-04 19:47 ` [PATCH 13/13] python/sepolicy: do not import types Nicolas Iooss
2018-08-06 15:05 ` [PATCH 00/13] Fix some issues found by flake8 William Roberts
2018-08-06 20:26   ` Nicolas Iooss
2018-08-07 17:01     ` William Roberts

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=20180804194734.12577-3-nicolas.iooss@m4x.org \
    --to=nicolas.iooss@m4x.org \
    --cc=selinux@tycho.nsa.gov \
    /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.