I think "from procfs.utillist import bitmasklist" is the best way to go there.
--Guy
On Tue, Jun 23, 2020 at 4:25 AM David Runge <dave(a)sleepmap.de> wrote:
>
> Hi! I package python-linux-procfs for Arch Linux.
>
> On 2020-06-19 16:43:41 (-0400), John Kacur wrote:
> > - Remove __future__
> > - Fix import
> > - Use list where required
> >
> > Signed-off-by: John Kacur <jkacur(a)redhat.com>
> > ---
> > procfs/procfs.py | 26 +++++++++++++-------------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/procfs/procfs.py b/procfs/procfs.py
> > index 83d142f4f27f..4d6332c9e5e1 100755
> > --- a/procfs/procfs.py
> > +++ b/procfs/procfs.py
> > @@ -18,11 +18,11 @@
> > # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> > #
> >
> > -from __future__ import absolute_import
> > -from __future__ import print_function
> > +
> > +
> > import os, time
> > from functools import reduce
> > -from .utilist import bitmasklist
> > +from utilist import bitmasklist
> > from six.moves import range
>
> This change to the import breaks running pflags after installation:
>
> ```
> $ pflags
> Traceback (most recent call last):
> File "/usr/bin/pflags", line 18, in <module>
> import procfs, re, fnmatch, sys
> File "/usr/lib/python3.8/site-packages/procfs/__init__.py", line 28, in
<module>
> from .procfs import *
> File "/usr/lib/python3.8/site-packages/procfs/procfs.py", line 24, in
<module>
> from utilist import bitmasklist
> ModuleNotFoundError: No module named 'utilist'
> ```
>
> and running bitmasklist_test.py during packaging:
>
> ```
> $ python bitmasklist_test.py
> Traceback (most recent call last):
> File "bitmasklist_test.py", line 3, in <module>
> from procfs import bitmasklist
> File
"/build/python-linux-procfs/src/python-linux-procfs-0.6.2/procfs/__init__.py",
line 28, in <module>
> from .procfs import *
> File
"/build/python-linux-procfs/src/python-linux-procfs-0.6.2/procfs/procfs.py",
line 24, in <module>
> from utilist import bitmasklist
> ModuleNotFoundError: No module named 'utilist'
> ```
>
> Reverting back to `from .utilist import bitmasklist` fixes this. I think a
> local import is totally fine, as both the procfs and utilist module are living
> in the same scope.
>
> Best,
> David
>
> --
>
https://sleepmap.de
> _______________________________________________
> tuna-devel mailing list -- tuna-devel(a)lists.fedorahosted.org
> To unsubscribe send an email to tuna-devel-leave(a)lists.fedorahosted.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedorahosted.org/archives/list/tuna-devel@lists.fedorahoste...