]> Dogcows Code - chaz/openbox/blobdiff - src/python.cc
move the restart into main.cc, so the openbox class can clean up properly before...
[chaz/openbox] / src / python.cc
index 874ad638b219215fc21089ba5b5304c085064a75..27434074700d3360b9a888dba71375091ee97c34 100644 (file)
@@ -32,7 +32,7 @@ void python_init(char *argv0)
   PyRun_SimpleString(const_cast<char*>(("sys.path.insert(0, '" +
                                         otk::expandTilde("~/.openbox/python") +
                                         "')").c_str()));
-  PyRun_SimpleString("import ob; import otk;");// import config;");
+  PyRun_SimpleString("import ob; import otk; import config;");
   // set up convenience global variables
   PyRun_SimpleString("ob.openbox = ob.Openbox_instance()");
   PyRun_SimpleString("otk.display = otk.Display_instance()");
@@ -44,14 +44,14 @@ void python_init(char *argv0)
 
 void python_destroy()
 {
-  Py_DECREF(obdict);
+  Py_Finalize();
 }
 
 bool python_exec(const std::string &path)
 {
   FILE *rcpyfd = fopen(path.c_str(), "r");
   if (!rcpyfd) {
-    printf("failed to load python file %s\n", path.c_str());
+    printf("Failed to load python file %s\n", path.c_str());
     return false;
   }
   PyRun_SimpleFile(rcpyfd, const_cast<char*>(path.c_str()));
This page took 0.021025 seconds and 4 git commands to generate.