summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/external_C_code/marty.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/userguide/external_C_code/marty.c')
-rw-r--r--docs/examples/userguide/external_C_code/marty.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/docs/examples/userguide/external_C_code/marty.c b/docs/examples/userguide/external_C_code/marty.c
index 8096ab19a..d7f5117f7 100644
--- a/docs/examples/userguide/external_C_code/marty.c
+++ b/docs/examples/userguide/external_C_code/marty.c
@@ -1,13 +1,14 @@
-# marty.c
-#include "delorean_api.h"
-
-Vehicle car;
-
-int main(int argc, char *argv[]) {
- Py_Initialize();
- import_delorean();
- car.speed = atoi(argv[1]);
- car.power = atof(argv[2]);
- activate(&car);
- Py_Finalize();
-}
+# marty.c
+#include "delorean_api.h"
+
+Vehicle car;
+
+int main(int argc, char *argv[]) {
+ Py_Initialize();
+ import_delorean();
+ car.speed = atoi(argv[1]);
+ car.power = atof(argv[2]);
+ activate(&car);
+ /* Error handling left out - call PyErr_Occurred() to test for Python exceptions. */
+ Py_Finalize();
+}