Skip to content

Commit 7ec68ce

Browse files
committed
Removes unnecessary EXECUTABLE_NAME macro.
1 parent e012327 commit 7ec68ce

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/debugging/XcodeExample/PythonSubclassList/PythonSubclassList.xcodeproj/xcuserdata/paulross.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
symbolName = "call_super_pyname"
7272
moduleName = "PythonSubclassList"
7373
urlString = "file:///Users/paulross/Documents/workspace/PythonExtensionPatterns/src/debugging/XcodeExample/PythonSubclassList/PythonSubclassList/py_call_super.c"
74-
timestampString = "486421243.866848"
74+
timestampString = "486491056.006566"
7575
startingColumnNumber = "9223372036854775807"
7676
endingColumnNumber = "9223372036854775807"
7777
startingLineNumber = "49"
@@ -85,7 +85,7 @@
8585
symbolName = "call_super_pyname"
8686
moduleName = "ScList.so"
8787
urlString = "file:///Users/paulross/Documents/workspace/PythonExtensionPatterns/src/debugging/XcodeExample/PythonSubclassList/PythonSubclassList/py_call_super.c"
88-
timestampString = "486421244.105144"
88+
timestampString = "486491056.315771"
8989
startingColumnNumber = "9223372036854775807"
9090
endingColumnNumber = "9223372036854775807"
9191
startingLineNumber = "49"

src/debugging/XcodeExample/PythonSubclassList/PythonSubclassList/main.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
#include <Python.h>
1010

11-
/** This should be the name of your executable.
12-
* It is just used for error messages. */
13-
#define EXECUTABLE_NAME "pyxcode"
14-
1511
/** Takes a path and adds it to sys.paths by calling PyRun_SimpleString.
1612
* This does rather laborious C string concatenation so that it will work in
1713
* a primitive C environment.
@@ -68,7 +64,7 @@ int import_call_execute(int argc, const char *argv[]) {
6864
if (argc != 4) {
6965
fprintf(stderr,
7066
"Wrong arguments!"
71-
" Usage: " EXECUTABLE_NAME " package_path module function\n");
67+
" Usage: %s package_path module function\n", argv[0]);
7268
return_value = -1;
7369
goto except;
7470
}
@@ -81,31 +77,31 @@ int import_call_execute(int argc, const char *argv[]) {
8177
pModule = PyImport_ImportModule(argv[2]);
8278
if (! pModule) {
8379
fprintf(stderr,
84-
EXECUTABLE_NAME ": Failed to load module \"%s\"\n", argv[2]);
80+
"%s: Failed to load module \"%s\"\n", argv[0], argv[2]);
8581
return_value = -3;
8682
goto except;
8783
}
8884
pFunc = PyObject_GetAttrString(pModule, argv[3]);
8985
if (! pFunc) {
9086
fprintf(stderr,
91-
EXECUTABLE_NAME ": Can not find function \"%s\"\n", argv[3]);
87+
"%s: Can not find function \"%s\"\n", argv[0], argv[3]);
9288
return_value = -4;
9389
goto except;
9490
}
9591
if (! PyCallable_Check(pFunc)) {
9692
fprintf(stderr,
97-
EXECUTABLE_NAME ": Function \"%s\" is not callable\n", argv[3]);
93+
"%s: Function \"%s\" is not callable\n", argv[0], argv[3]);
9894
return_value = -5;
9995
goto except;
10096
}
10197
pResult = PyObject_CallObject(pFunc, NULL);
10298
if (! pResult) {
103-
fprintf(stderr, EXECUTABLE_NAME ": Function call failed\n");
99+
fprintf(stderr, "%s: Function call failed\n", argv[0]);
104100
return_value = -6;
105101
goto except;
106102
}
107103
#ifdef DEBUG
108-
printf(EXECUTABLE_NAME ": PyObject_CallObject() succeeded\n");
104+
printf("%s: PyObject_CallObject() succeeded\n", argv[0]);
109105
#endif
110106
assert(! PyErr_Occurred());
111107
goto finally;

0 commit comments

Comments
 (0)