diff options
author | Lumir Balhar <lbalhar@redhat.com> | 2017-11-06 10:37:40 +0100 |
---|---|---|
committer | Jiri Kastner <jkastner@redhat.com> | 2017-11-20 13:59:01 +0100 |
commit | 2cf2e01a7155e9e2ca6bdb03a1b746eaf88cefd8 (patch) | |
tree | 09496a99dfb258100aaae624177cadb69550b037 | |
parent | 6398eee30f27b6d4f7eb3a708dd8307e14972b5b (diff) | |
download | python-linux-procfs-2cf2e01a7155e9e2ca6bdb03a1b746eaf88cefd8.tar.gz |
python3: Use absolute import for import from local modules
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
-rw-r--r-- | procfs/__init__.py | 8 | ||||
-rwxr-xr-x | procfs/procfs.py | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/procfs/__init__.py b/procfs/__init__.py index 8d5f68b..7fd67ae 100644 --- a/procfs/__init__.py +++ b/procfs/__init__.py @@ -22,9 +22,11 @@ Copyright (c) 2008, 2009 Red Hat Inc. Abstractions to extract information from the Linux kernel /proc files. """ +from __future__ import absolute_import + __author__ = "Arnaldo Carvalho de Melo <acme@redhat.com>" __license__ = "GPLv2 License" -from procfs import * -from sysctl import * -from utilist import * +from .procfs import * +from .sysctl import * +from .utilist import * diff --git a/procfs/procfs.py b/procfs/procfs.py index 5a069a9..bc78b75 100755 --- a/procfs/procfs.py +++ b/procfs/procfs.py @@ -18,7 +18,11 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -import os, time, utilist +from __future__ import absolute_import +from __future__ import print_function +import os, time +from .utilist import bitmasklist +from six.moves import range VERSION="0.3" @@ -626,7 +630,7 @@ class interrupts: f = open("/proc/irq/%s/smp_affinity" % irq) line = f.readline() f.close() - return utilist.bitmasklist(line, self.nr_cpus) + return bitmasklist(line, self.nr_cpus) except IOError: return [ 0, ] |