summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xportato.py9
-rw-r--r--portato/plistener.py9
2 files changed, 12 insertions, 6 deletions
diff --git a/portato.py b/portato.py
index 3f94d25..c7cea74 100755
--- a/portato.py
+++ b/portato.py
@@ -75,10 +75,13 @@ def main ():
else: # start us again in root modus and launch listener
- try:
- import shm_wrapper as shm
+ try: # local version
+ from _shm import shm_wrapper as shm
except ImportError:
- from portato._shm import shm_wrapper as shm
+ try: # version installed together with portato
+ from portato._shm import shm_wrapper as shm
+ except ImportError: # the normal shm module
+ import shm_wrapper as shm
mem = shm.create_memory(1024, permissions=0600)
sig = shm.create_semaphore(InitialValue = 0, permissions = 0600)
diff --git a/portato/plistener.py b/portato/plistener.py
index 2e35ccb..848e71e 100644
--- a/portato/plistener.py
+++ b/portato/plistener.py
@@ -91,10 +91,13 @@ class PListener (object):
self._sig = None
self._rw = None
else:
- try:
- import shm_wrapper as shm
+ try: # local version
+ from _shm import shm_wrapper as shm
except ImportError:
- from portato._shm import shm_wrapper as shm
+ try: # version installed together with portato
+ from portato._shm import shm_wrapper as shm
+ except ImportError: # the normal shm module
+ import shm_wrapper as shm
self._mem = shm.SharedMemoryHandle(mem)
self._sig = shm.SemaphoreHandle(sig)