]> git.sesse.net Git - vlc/commitdiff
python bindings: use new mediacontrol_exception_create function
authorOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Thu, 3 May 2007 20:03:09 +0000 (20:03 +0000)
committerOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Thu, 3 May 2007 20:03:09 +0000 (20:03 +0000)
bindings/python/vlcglue.h

index ad5509c3ab07a4b0d6bf7fb4f2854af73e84d813..4a1b98f5b9816c52c8df4189aac230ea30d9ff21 100644 (file)
@@ -46,10 +46,10 @@ typedef int Py_ssize_t;
  * Exceptions handling
  **********************************************************************/
 
-#define MC_TRY exception=mediacontrol_exception_init(exception)
+#define MC_TRY exception=mediacontrol_exception_create( )
 
 #define MC_EXCEPT  \
-  if( exception->code ) { \
+  if( exception && exception->code ) { \
     PyObject *py_exc = MediaControl_InternalException; \
     switch( exception->code ) { \
     case mediacontrol_InternalException: \
@@ -71,7 +71,7 @@ typedef int Py_ssize_t;
     PyErr_SetString( py_exc, exception->message ); \
     mediacontrol_exception_free( exception ); \
     return NULL; \
-  } else { mediacontrol_exception_free( exception ); }
+  } else if( exception ) { mediacontrol_exception_free( exception ); }
 
 PyObject *MediaControl_InternalException;
 PyObject *MediaControl_PositionKeyNotSupported;