All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 4/4] python/sepolicy: Do not use types.BooleanType
Date: Wed, 14 Feb 2018 10:53:37 +0100	[thread overview]
Message-ID: <20180214095337.1945-5-plautrba@redhat.com> (raw)
In-Reply-To: <20180214095337.1945-1-plautrba@redhat.com>

It was removed from Python 3

Fixes:
File "polgengui.py", line 390, in forward
  self.generate_policy()
File "polgengui.py", line 491, in generate_policy
  my_policy.set_use_syslog(self.syslog_checkbutton.get_active() == 1)
File "/home/plautrba/devel/github/bachradsusi/SELinuxProject-selinux/python/sepolicy/sepolicy/generate.py",  line 468, in set_use_syslog
  if not isinstance(val, types.BooleanType):
AttributeError: module 'types' has no attribute 'BooleanType'

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 python/sepolicy/sepolicy/generate.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/sepolicy/sepolicy/generate.py b/python/sepolicy/sepolicy/generate.py
index 1b36eb6e..31aa968f 100644
--- a/python/sepolicy/sepolicy/generate.py
+++ b/python/sepolicy/sepolicy/generate.py
@@ -459,25 +459,25 @@ class policy:
         self.out_udp = [all, False, False, verify_ports(ports)]
 
     def set_use_resolve(self, val):
-        if not isinstance(val, types.BooleanType):
+        if type(val) is not bool:
             raise ValueError(_("use_resolve must be a boolean value "))
 
         self.use_resolve = val
 
     def set_use_syslog(self, val):
-        if not isinstance(val, types.BooleanType):
+        if type(val) is not bool:
             raise ValueError(_("use_syslog must be a boolean value "))
 
         self.use_syslog = val
 
     def set_use_kerberos(self, val):
-        if not isinstance(val, types.BooleanType):
+        if type(val) is not bool:
             raise ValueError(_("use_kerberos must be a boolean value "))
 
         self.use_kerberos = val
 
     def set_manage_krb5_rcache(self, val):
-        if not isinstance(val, types.BooleanType):
+        if type(val) is not bool:
             raise ValueError(_("manage_krb5_rcache must be a boolean value "))
 
         self.manage_krb5_rcache = val
-- 
2.16.1

  parent reply	other threads:[~2018-02-14  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  9:53 Update selinux-sepolgengui to be compatible with Gtk3, Python 3 Petr Lautrbach
2018-02-14  9:53 ` [PATCH 1/4] gui/polgengui.py: Fix sepolicy.generate import in polgengui.py Petr Lautrbach
2018-02-14  9:53 ` [PATCH 2/4] gui/polgengui.py: Convert polgen.glade to Builder format polgen.ui Petr Lautrbach
2018-02-14  9:53 ` [PATCH 3/4] python/sepolicy: Use list instead of map Petr Lautrbach
2018-02-14  9:53 ` Petr Lautrbach [this message]
2018-02-18 18:09 ` Update selinux-sepolgengui to be compatible with Gtk3, Python 3 Nicolas Iooss
2018-02-18 18:20   ` Nicolas Iooss
2018-02-22 15:31     ` Petr Lautrbach
2018-02-22 16:59       ` Petr Lautrbach
2018-02-22 19:09         ` Nicolas Iooss
2018-02-23 20:29           ` Stephen Smalley

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=20180214095337.1945-5-plautrba@redhat.com \
    --to=plautrba@redhat.com \
    --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.