summaryrefslogtreecommitdiff
path: root/demo/pwuid.py
diff options
context:
space:
mode:
Diffstat (limited to 'demo/pwuid.py')
-rw-r--r--demo/pwuid.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/demo/pwuid.py b/demo/pwuid.py
index 650b9da..dda9299 100644
--- a/demo/pwuid.py
+++ b/demo/pwuid.py
@@ -1,18 +1,7 @@
import sys, os
-# If the build script was run immediately before this script, the cffi module
-# ends up in the current directory. Make sure we can import it.
-sys.path.append('.')
+# run pwuid_build first, then make sure the shared object is on sys.path
+from _pwuid_cffi import ffi, lib
-try:
- from _pwuid import ffi, lib
-except ImportError:
- print 'run pwuid_build first, then make sure the shared object is on sys.path'
- sys.exit(-1)
-
-# ffi "knows" about the declared variables and functions from the
-# cdef parts of the module xclient_build created,
-# lib "knows" how to call the functions from the set_source parts
-# of the module.
print ffi.string(lib.getpwuid(0).pw_name)