summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python_append.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/python_append.i')
-rw-r--r--Examples/test-suite/python_append.i27
1 files changed, 16 insertions, 11 deletions
diff --git a/Examples/test-suite/python_append.i b/Examples/test-suite/python_append.i
index e263c392b..f37a6c199 100644
--- a/Examples/test-suite/python_append.i
+++ b/Examples/test-suite/python_append.i
@@ -5,22 +5,22 @@ Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
%module python_append
%pythoncode %{
- mypath = os.path.dirname("/a/b/c/d.txt")
- funcpath = None
- staticfuncpath = None
- def grabpath():
+mypath = os.path.dirname("/a/b/c/d.txt")
+funcpath = None
+staticfuncpath = None
+def grabpath():
return funcpath
- def grabstaticpath():
+def grabstaticpath():
return staticfuncpath
%}
%pythonappend Test::func %{
- funcpath = os.path.dirname(funcpath)
+funcpath = os.path.dirname(funcpath)
%}
%pythonprepend Test::func %{
- global funcpath
- funcpath = mypath
+global funcpath
+funcpath = mypath
%}
%pythonappend Test::static_func %{
@@ -29,9 +29,9 @@ pass
%}
%pythonprepend Test::static_func {
- global staticfuncpath
- staticfuncpath = mypath
- pass
+global staticfuncpath
+staticfuncpath = mypath
+pass
}
%pythonbegin %{
@@ -46,5 +46,10 @@ public:
void func() {};
};
+#ifdef SWIGPYTHON_BUILTIN
+bool is_python_builtin() { return true; }
+#else
+bool is_python_builtin() { return false; }
+#endif
%}