Author: Armin Rigo <[email protected]>
Branch: demo-cleanup
Changeset: r2542:d1669b7461e4
Date: 2016-01-07 16:53 +0100
http://bitbucket.org/cffi/cffi/changeset/d1669b7461e4/
Log: tweaks
diff --git a/demo/readdir2.py b/demo/readdir2.py
--- a/demo/readdir2.py
+++ b/demo/readdir2.py
@@ -5,15 +5,9 @@
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
--- a/demo/readdir2_build.py
+++ b/demo/readdir2_build.py
@@ -20,7 +20,7 @@
static const int DT_DIR;
""")
-ffi.set_source("_readdir2", """
+ffi.set_source("_readdir2_cffi", """
#ifndef _ATFILE_SOURCE
# define _ATFILE_SOURCE
#endif
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit