diff options
Diffstat (limited to 'demo')
-rw-r--r-- | demo/readdir2.py | 10 | ||||
-rw-r--r-- | demo/readdir2_build.py | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/demo/readdir2.py b/demo/readdir2.py index 64fc60f..b564b51 100644 --- a/demo/readdir2.py +++ b/demo/readdir2.py @@ -5,15 +5,9 @@ import sys if not sys.platform.startswith('linux'): raise Exception("Linux-only demo") -# 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 readdir2_build first, then make sure the shared object is on sys.path +from _readdir2_cffi import ffi, lib -try: - from _readdir2 import ffi, lib -except ImportError: - print 'run readdir2_build first, then make sure the shared object is on sys.path' - sys.exit(-1) def walk(basefd, path): print '{', path diff --git a/demo/readdir2_build.py b/demo/readdir2_build.py index 50d17b4..5cfd872 100644 --- a/demo/readdir2_build.py +++ b/demo/readdir2_build.py @@ -20,7 +20,7 @@ ffi.cdef(""" static const int DT_DIR; """) -ffi.set_source("_readdir2", """ +ffi.set_source("_readdir2_cffi", """ #ifndef _ATFILE_SOURCE # define _ATFILE_SOURCE #endif |