summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-01-07 16:55:22 +0100
committerArmin Rigo <arigo@tunes.org>2016-01-07 16:55:22 +0100
commit3d079fe77d642011c9b925621c9c1a92b546e8b8 (patch)
treead5ef523cf772ef170eb4ae9b5f01d315d4cbb76 /demo
parent53fcb5e73a2433476482452269199f5139ece3d8 (diff)
downloadcffi-3d079fe77d642011c9b925621c9c1a92b546e8b8.tar.gz
tweaks
Diffstat (limited to 'demo')
-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()
-