SELinux Archive on lore.kernel.org
 help / color / Atom feed
* ImportError: cannot import name '_selinux' from 'selinux' with swig-4.0.0
@ 2019-05-16 15:37 Petr Lautrbach
  0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2019-05-16 15:37 UTC (permalink / raw)
  To: selinux\

Hello all,

selinux python module can't be imported when it's built using
swig-4.0.0:

>>> import selinux
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.7/site-packages/selinux/__init__.py", 
  line 13, in <module>
    from . import _selinux
ImportError: cannot import name '_selinux' from 'selinux' 
(/usr/lib64/python3.7/site-packages/selinux/__init__.py)
>>>

You can see it at [1]

The reason is that swig changed the way how it generates 
__init__.py.
Now it uses:
from . import _selinux

I've started to rewrite libselinux in order not to build and 
install
python bindings manually, but to use python distutils [2]. It 
still fails
on travis but I was able to built it and use it on my local 
rawhide machine.


[1] 
https://groups.google.com/forum/#!topic/kernel-secnext/rGZxB39atVQ
[2] 
https://github.com/bachradsusi/SELinuxProject-selinux/commits/swig-use-python-distutils

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 15:37 ImportError: cannot import name '_selinux' from 'selinux' with swig-4.0.0 Petr Lautrbach

SELinux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux/0 selinux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux selinux/ https://lore.kernel.org/selinux \
		selinux@vger.kernel.org selinux@archiver.kernel.org
	public-inbox-index selinux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox