[pypy-commit] cffi demo-cleanup: tweaks
arigo
pypy.commits at gmail.com
Thu Jan 7 10:55:49 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: demo-cleanup
Changeset: r2543:ee6bdacc57db
Date: 2016-01-07 16:54 +0100
http://bitbucket.org/cffi/cffi/changeset/ee6bdacc57db/
Log: tweaks
diff --git a/demo/winclipboard.py b/demo/winclipboard.py
--- a/demo/winclipboard.py
+++ b/demo/winclipboard.py
@@ -5,18 +5,14 @@
if not sys.platform == 'win32':
raise Exception("Windows-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('.')
-
try:
- from _winclipboard import ffi, lib
+ from _winclipboard_cffi import ffi, lib
except ImportError:
print 'run winclipboard_build first, then make sure the shared object is on sys.path'
- sys.exit(-1)
+ sys.exit(1)
# ffi "knows" about the declared variables and functions from the
-# cdef parts of the module xclient_build created,
+# cdef parts of the module _winclipboard_cffi created,
# lib "knows" how to call the functions from the set_source parts
# of the module.
diff --git a/demo/winclipboard_build.py b/demo/winclipboard_build.py
--- a/demo/winclipboard_build.py
+++ b/demo/winclipboard_build.py
@@ -28,7 +28,7 @@
void * memcpy(void * s1, void * s2, int n);
''')
-ffi.set_source('_winclipboard', '''
+ffi.set_source('_winclipboard_cffi', '''
#include <windows.h>
''', libraries=["user32"])
More information about the pypy-commit
mailing list