summaryrefslogtreecommitdiff
path: root/demo/pwuid.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-01-07 16:52:47 +0100
committerArmin Rigo <arigo@tunes.org>2016-01-07 16:52:47 +0100
commit25cbb21c410dd172b98438e6219ff54ccbc8cf09 (patch)
treee201193ce823c28f604ea903d33fc32b022b67ec /demo/pwuid.py
parente219e611f2a9ff3070de73836f9a56177549a7c0 (diff)
downloadcffi-25cbb21c410dd172b98438e6219ff54ccbc8cf09.tar.gz
tweaks
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)