summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo/xclient.py10
-rw-r--r--demo/xclient_build.py3
2 files changed, 3 insertions, 10 deletions
diff --git a/demo/xclient.py b/demo/xclient.py
index 37e7597..e4b3dd2 100644
--- a/demo/xclient.py
+++ b/demo/xclient.py
@@ -1,14 +1,8 @@
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 xclient_build first, then make sure the shared object is on sys.path
+from _xclient_cffi import ffi, lib
-try:
- from _xclient import ffi, lib
-except ImportError:
- print 'run xclient_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,
diff --git a/demo/xclient_build.py b/demo/xclient_build.py
index 57ec008..943763f 100644
--- a/demo/xclient_build.py
+++ b/demo/xclient_build.py
@@ -17,10 +17,9 @@ Window XCreateSimpleWindow(Display *display, Window parent, int x, int y,
int XNextEvent(Display *display, XEvent *event_return);
""")
-ffi.set_source('_xclient', """
+ffi.set_source('_xclient_cffi', """
#include <X11/Xlib.h>
""", libraries=['X11'])
if __name__ == '__main__':
ffi.compile()
-