Imported Upstream version 3.3.1
[platform/upstream/pygobject2.git] / gi / _glib / pygoptioncontext.c
similarity index 95%
rename from gi/pygoptioncontext.c
rename to gi/_glib/pygoptioncontext.c
index 50c32fb..b985dbe 100644 (file)
@@ -15,7 +15,9 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
  */
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #include <pyglib.h>
+#include "pyglib-private.h"
 #include "pygoptioncontext.h"
-#include "pygi-error.h"
 
-PYGLIB_DEFINE_TYPE("gi._gi.OptionContext", PyGOptionContext_Type, PyGOptionContext)
+PYGLIB_DEFINE_TYPE("gi._glib.OptionContext", PyGOptionContext_Type, PyGOptionContext)
 
 /**
  * pyg_option_context_new:
@@ -56,7 +58,7 @@ pyg_option_context_init(PyGOptionContext *self,
 {
     char *parameter_string;
 
-    if (!PyArg_ParseTuple(args, "s:gi._gi.GOptionContext.__init__",
+    if (!PyArg_ParseTuple(args, "s:gi._glib.GOptionContext.__init__",
                           &parameter_string))
         return -1;
 
@@ -128,17 +130,17 @@ pyg_option_context_parse(PyGOptionContext *self,
 
     g_assert(argv_length <= G_MAXINT);
     argv_length_int = argv_length;
-    Py_BEGIN_ALLOW_THREADS;
+    pyglib_begin_allow_threads;
     result = g_option_context_parse(self->context, &argv_length_int, &argv_content,
                                     &error);
-    Py_END_ALLOW_THREADS;
+    pyglib_end_allow_threads;
     argv_length = argv_length_int;
 
     if (!result)
     {
         g_strfreev(argv_content);
         g_strfreev(original);
-        pygi_error_check(&error);
+        pyglib_error_check(&error);
         return NULL;
     }