aboutsummaryrefslogtreecommitdiffstats
path: root/setup_c_extension.py
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2022-03-01 10:34:03 +0100
committerNao Pross <np@0hm.ch>2022-03-01 10:34:03 +0100
commit3077bbea252c62e8abf825ad11bf5118d79a2ba3 (patch)
tree585faa0c5e1964b01c60c9ca31d8dfa4fb61888e /setup_c_extension.py
parentMethod to find arrayobject.h path on any distro (diff)
downloado3000-python-binding-3077bbea252c62e8abf825ad11bf5118d79a2ba3.tar.gz
o3000-python-binding-3077bbea252c62e8abf825ad11bf5118d79a2ba3.zip
Add Python error handling to video_images_getHEADmaster
If for any reason the data stream from the camera is no longer available, without these checks the entire python interpreter crashes with a nice segmentation fault. These checks allow to handle the error from within Python with something like: try: o3000.video_images_get() except RuntimeError: ... restart o3000 driver Also, there is a change in the compilation flags to show more (useful) warnings, i.e. -Wall and hide the "unused variable" warning.
Diffstat (limited to 'setup_c_extension.py')
-rw-r--r--setup_c_extension.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup_c_extension.py b/setup_c_extension.py
index e01837f..f1f3e08 100644
--- a/setup_c_extension.py
+++ b/setup_c_extension.py
@@ -12,5 +12,5 @@ setup(name = 'o3000', version = '1.0',
sources = ['c_extension.c', 'helpers.c'],
libraries = ['o3000', 'o3000_imgpipe', 'tiff'],
include_dirs = [str(numpy_headers_path)],
- # extra_compile_args = ['-Wextra']
+ extra_compile_args = ['-Wextra', '-Wall', '-Wno-unused-parameter']
)])