summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:50:39 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:50:42 +0900
commitf3eae5a895fc60cb99c0c366bdd011018ce3bc7b (patch)
tree05145bd5ec6ec44e6cb9d5604ade02923e66d6a0
parent942efc88315506d2a299ae79d05fa8dfe00f8166 (diff)
downloadpygobject2-f3eae5a895fc60cb99c0c366bdd011018ce3bc7b.tar.gz
pygobject2-f3eae5a895fc60cb99c0c366bdd011018ce3bc7b.tar.bz2
pygobject2-f3eae5a895fc60cb99c0c366bdd011018ce3bc7b.zip
Imported Upstream version 3.9.92upstream/3.9.92upstream
Change-Id: I568bb088bda84501eabdd8ad9d0224c88b73695e Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r--ChangeLog63
-rw-r--r--Makefile.in4
-rw-r--r--NEWS7
-rw-r--r--PKG-INFO4
-rw-r--r--README3
-rw-r--r--aclocal.m4660
-rwxr-xr-xconfigure32
-rw-r--r--configure.ac2
-rw-r--r--gi/overrides/GLib.py2
-rw-r--r--gi/overrides/__init__.py1
-rw-r--r--gi/pygi-marshal-from-py.c53
-rw-r--r--tests/test_source.py11
12 files changed, 463 insertions, 379 deletions
diff --git a/ChangeLog b/ChangeLog
index bd51bef..106435e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+commit 506f1e35a9375be80a6a79421bf8272165fdd90a
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Mon Sep 16 01:23:49 2013 -0700
+
+ Update current maintainers list in README
+
+ README | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit ef120498e060e88a1efcb82de385a23c1fa9c7da
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Tue Sep 10 17:11:21 2013 -0700
+
+ Fix union argument regression when marshaling from python
+
+ Check for union members when marshaling boxed types from Python.
+ This is a regression caused by stricter type checking added when
+ merging code from pygi-argument.c.
+ Re-add pyg_boxed_check to the same bit of code in addition to
+ __gtype__ checking to avoid a double regression.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=703873
+
+ gi/pygi-marshal-from-py.c | 53
+ ++++++++++++++++++++++++++---------------------
+ 1 file changed, 29 insertions(+), 24 deletions(-)
+
+commit 59a2964141e963d2961e55d4b84a777927b4f21b
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Wed Sep 11 05:05:33 2013 -0700
+
+ Fix GLib.Source sub-classing with initializer args
+
+ Add variable args and keyword args to the GLib.Source.__new__
+ method to support sub-classes which want to implement __init__.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=707904
+
+ gi/overrides/GLib.py | 2 +-
+ tests/test_source.py | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+commit afa42ab95327da1de0cf86005974cd8ab0d46872
+Author: Vratislav Podzimek <vpodzime@redhat.com>
+Date: Wed Sep 4 14:17:31 2013 +0200
+
+ Copy __doc__ when wrapping function
+
+ Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
+ Signed-off-by: Martin Pitt <martinpitt@gnome.org>
+
+ gi/overrides/__init__.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 7914a6828a533d8c579a5b422351e18b9f9afc8c
+Author: Martin Pitt <martinpitt@gnome.org>
+Date: Mon Sep 2 14:56:24 2013 +0200
+
+ configure.ac: post-release bump to 3.9.92
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
commit ad8b7d1a89eb2d030a504d521f7589a4c1d835fb
Author: Martin Pitt <martinpitt@gnome.org>
Date: Mon Sep 2 14:38:41 2013 +0200
diff --git a/Makefile.in b/Makefile.in
index 5dc4686..7ee9ff7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -85,8 +85,8 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/config.h.in $(srcdir)/pygobject-3.0.pc.in \
$(srcdir)/pygobject-3.0-uninstalled.pc.in \
$(srcdir)/PKG-INFO.in AUTHORS COPYING ChangeLog INSTALL NEWS \
- README compile config.guess config.sub install-sh missing \
- ltmain.sh
+ README compile config.guess config.sub depcomp install-sh \
+ missing py-compile ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \
diff --git a/NEWS b/NEWS
index 43966b5..c445bf2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+3.9.92 16-Sep-2013
+ - Fix union argument regression when marshaling from python
+ (Simon Feltman) (#703873)
+ - Fix GLib.Source sub-classing with initializer args (Simon Feltman)
+ (#707904)
+ - Copy __doc__ when wrapping function (Vratislav Podzimek)
+
3.9.91 02-Sep-2013
- Fix GObject signal methods to work with new annotations
(Simon Feltman) (#707280)
diff --git a/PKG-INFO b/PKG-INFO
index 3246cfe..726498b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: PyGObject
-Version: 3.9.91
+Version: 3.9.92
Summary: Python bindings for GObject
Home-page: http://www.pygtk.org/
Author: James Henstridge
@@ -8,7 +8,7 @@ Author-email: james@daa.com.au
Maintainer: Johan Dahlin
Maintainer-email: johan@gnome.org
License: GNU LGPL
-Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.9/pygobject-3.9.91.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.9/pygobject-3.9.92.tar.gz
Description: Python bindings for GLib and GObject
Platform: POSIX, Windows
Classifier: Development Status :: 5 - Production/Stable
diff --git a/README b/README
index 47a4c9d..7530c61 100644
--- a/README
+++ b/README
@@ -8,7 +8,8 @@ Current maintainers: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
Paolo Borelli <pborelli@gnome.org>
Ignacio Casal Quinteiro <icq@gnome.org>
Sebastian Pölsterl <sebp@k-d-w.org>
-
+ Simon Feltman <sfeltman@gnome.org>
+
This archive contains bindings for the GLib, and GObject,
to be used in Python. It is a fairly complete set of bindings,
diff --git a/aclocal.m4 b/aclocal.m4
index bdea7ef..2ef1960 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1321,6 +1321,335 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+dnl GNOME_CODE_COVERAGE
+dnl
+dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
+dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
+dnl (program or library) which should be built with code coverage support.
+dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
+dnl Makefile; and $enable_code_coverage which can be used in subsequent
+dnl configure output.
+dnl
+dnl Note that all optimisation flags in CFLAGS must be disabled when code
+dnl coverage is enabled.
+dnl
+dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
+dnl This file is licenced under LGPLv2.1+.
+dnl
+dnl Usage example:
+dnl configure.ac:
+dnl GNOME_CODE_COVERAGE
+dnl
+dnl Makefile.am:
+dnl @GNOME_CODE_COVERAGE_RULES@
+dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
+dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
+dnl
+dnl This results in a “check-code-coverage” rule being added to any Makefile.am
+dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
+dnl configured with --enable-code-coverage). Running `make check-code-coverage`
+dnl in that directory will run the module’s test suite (`make check`) and build
+dnl a code coverage report detailing the code which was touched, then print the
+dnl URI for the report.
+
+AC_DEFUN([GNOME_CODE_COVERAGE],[
+ dnl Check for --enable-code-coverage
+ AC_MSG_CHECKING([whether to build with code coverage support])
+ AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
+ AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
+ AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
+ AC_MSG_RESULT($enable_code_coverage)
+
+ AS_IF([ test "$enable_code_coverage" = "yes" ], [
+ dnl Check if gcc is being used
+ AS_IF([ test "$GCC" = "no" ], [
+ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
+ ])
+
+ # List of supported lcov versions.
+ lcov_version_list="1.6 1.7 1.8 1.9"
+
+ AC_CHECK_PROG([LCOV], [lcov], [lcov])
+ AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
+
+ AS_IF([ test "$LCOV" ], [
+ AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
+ gnome_cv_lcov_version=invalid
+ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
+ for lcov_check_version in $lcov_version_list; do
+ if test "$lcov_version" = "$lcov_check_version"; then
+ gnome_cv_lcov_version="$lcov_check_version (ok)"
+ fi
+ done
+ ])
+ ], [
+ lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
+ AC_MSG_ERROR([$lcov_msg])
+ ])
+
+ case $gnome_cv_lcov_version in
+ ""|invalid[)]
+ lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
+ AC_MSG_ERROR([$lcov_msg])
+ LCOV="exit 0;"
+ ;;
+ esac
+
+ AS_IF([ test -z "$GENHTML" ], [
+ AC_MSG_ERROR([Could not find genhtml from the lcov package])
+ ])
+
+ dnl Build the code coverage flags
+ CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+ CODE_COVERAGE_LDFLAGS="-lgcov"
+
+ AC_SUBST([CODE_COVERAGE_CFLAGS])
+ AC_SUBST([CODE_COVERAGE_LDFLAGS])
+ ])
+
+GNOME_CODE_COVERAGE_RULES='
+# Code coverage
+#
+# Optional:
+# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
+# (Default: $(top_builddir))
+# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
+# by lcov for code coverage. (Default:
+# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
+# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
+# reports to be created. (Default:
+# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
+# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
+# (Default: empty)
+# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
+# instance. (Default: empty)
+# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
+#
+# The generated report will be titled using the $(PACKAGE_NAME) and
+# $(PACKAGE_VERSION). In order to add the current git hash to the title,
+# use the git-version-gen script, available online.
+
+# Optional variables
+CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
+CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
+CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
+CODE_COVERAGE_LCOV_OPTIONS ?=
+CODE_COVERAGE_GENHTML_OPTIONS ?=
+CODE_COVERAGE_IGNORE_PATTERN ?=
+
+code_coverage_quiet = $(code_coverage_quiet_$(V))
+code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
+code_coverage_quiet_0 = --quiet
+
+# Use recursive makes in order to ignore errors during check
+check-code-coverage:
+ifdef CODE_COVERAGE_ENABLED
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+else
+ @echo "Need to reconfigure with --enable-code-coverage"
+endif
+
+# Capture code coverage data
+code-coverage-capture: code-coverage-capture-hook
+ifdef CODE_COVERAGE_ENABLED
+ $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
+ $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
+ -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+ LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
+ @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+else
+ @echo "Need to reconfigure with --enable-code-coverage"
+endif
+
+# Hook rule executed before code-coverage-capture, overridable by the user
+code-coverage-capture-hook:
+
+clean: code-coverage-clean
+code-coverage-clean:
+ -$(LCOV) --directory $(top_builddir) -z
+ -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+ -find . -name "*.gcda" -o -name "*.gcov" -delete
+
+GITIGNOREFILES ?=
+GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+
+DISTCHECK_CONFIGURE_FLAGS ?=
+DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
+
+.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
+'
+
+ AC_SUBST([GNOME_CODE_COVERAGE_RULES])
+ m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
+])
+
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings and substitute the result into
+dnl WARN_CFLAGS
+dnl For now, only works on GCC
+AC_DEFUN([GNOME_COMPILE_WARNINGS],[
+ dnl ******************************
+ dnl More compiler warnings
+ dnl ******************************
+
+ AC_ARG_ENABLE(compile-warnings,
+ AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+ [Turn on compiler warnings]),,
+ [enable_compile_warnings="m4_default([$1],[yes])"])
+
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+
+ warning_flags=
+ realsave_CFLAGS="$CFLAGS"
+
+ dnl These are warning flags that aren't marked as fatal. Can be
+ dnl overridden on a per-project basis with -Wno-foo.
+ base_warn_flags=" \
+ -Wall \
+ -Wstrict-prototypes \
+ -Wnested-externs \
+ "
+
+ dnl These compiler flags typically indicate very broken or suspicious
+ dnl code. Some of them such as implicit-function-declaration are
+ dnl just not default because gcc compiles a lot of legacy code.
+ dnl We choose to make this set into explicit errors.
+ base_error_flags=" \
+ -Werror=missing-prototypes \
+ -Werror=implicit-function-declaration \
+ -Werror=pointer-arith \
+ -Werror=init-self \
+ -Werror=format-security \
+ -Werror=format=2 \
+ -Werror=missing-include-dirs \
+ "
+
+ case "$enable_compile_warnings" in
+ no)
+ warning_flags=
+ ;;
+ minimum)
+ warning_flags="-Wall"
+ ;;
+ yes)
+ warning_flags="$base_warn_flags $base_error_flags"
+ ;;
+ maximum|error)
+ warning_flags="$base_warn_flags $base_error_flags"
+ ;;
+ *)
+ AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
+ ;;
+ esac
+
+ if test "$enable_compile_warnings" = "error" ; then
+ warning_flags="$warning_flags -Werror"
+ fi
+
+ dnl Check whether GCC supports the warning options
+ for option in $warning_flags; do
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([whether gcc understands $option])
+ AC_TRY_COMPILE([], [],
+ has_option=yes,
+ has_option=no,)
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT([$has_option])
+ if test $has_option = yes; then
+ tested_warning_flags="$tested_warning_flags $option"
+ fi
+ unset has_option
+ unset save_CFLAGS
+ done
+ unset option
+ CFLAGS="$realsave_CFLAGS"
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ AC_MSG_RESULT($tested_warning_flags)
+
+ AC_ARG_ENABLE(iso-c,
+ AC_HELP_STRING([--enable-iso-c],
+ [Try to warn if code is not ISO C ]),,
+ [enable_iso_c=no])
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+ complCFLAGS=
+ if test "x$enable_iso_c" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -ansi" ;;
+ esac
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCFLAGS)
+
+ WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
+ AC_SUBST(WARN_CFLAGS)
+])
+
+dnl For C++, do basically the same thing.
+
+AC_DEFUN([GNOME_CXX_WARNINGS],[
+ AC_ARG_ENABLE(cxx-warnings,
+ AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
+ [Turn on compiler warnings.]),,
+ [enable_cxx_warnings="m4_default([$1],[minimum])"])
+
+ AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+ warnCXXFLAGS=
+ if test "x$GXX" != xyes; then
+ enable_cxx_warnings=no
+ fi
+ if test "x$enable_cxx_warnings" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+ esac
+
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_cxx_warnings" = "xyes"; then
+ warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCXXFLAGS)
+
+ AC_ARG_ENABLE(iso-cxx,
+ AC_HELP_STRING([--enable-iso-cxx],
+ [Try to warn if code is not ISO C++ ]),,
+ [enable_iso_cxx=no])
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+ complCXXFLAGS=
+ if test "x$enable_iso_cxx" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+ esac
+
+ case " $CXXFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCXXFLAGS)
+
+ WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+ AC_SUBST(WARN_CXXFLAGS)
+])
+
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
@@ -1696,337 +2025,6 @@ main ()
rm -f conf.glibtest
])
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
-dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
-dnl (program or library) which should be built with code coverage support.
-dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
-dnl Makefile; and $enable_code_coverage which can be used in subsequent
-dnl configure output.
-dnl
-dnl Note that all optimisation flags in CFLAGS must be disabled when code
-dnl coverage is enabled.
-dnl
-dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
-dnl This file is licenced under LGPLv2.1+.
-dnl
-dnl Usage example:
-dnl configure.ac:
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Makefile.am:
-dnl @GNOME_CODE_COVERAGE_RULES@
-dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
-dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
-dnl
-dnl This results in a “check-code-coverage” rule being added to any Makefile.am
-dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
-dnl configured with --enable-code-coverage). Running `make check-code-coverage`
-dnl in that directory will run the module’s test suite (`make check`) and build
-dnl a code coverage report detailing the code which was touched, then print the
-dnl URI for the report.
-
-AC_DEFUN([GNOME_CODE_COVERAGE],[
- dnl Check for --enable-code-coverage
- AC_MSG_CHECKING([whether to build with code coverage support])
- AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
- AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
- AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
- AC_MSG_RESULT($enable_code_coverage)
-
- AS_IF([ test "$enable_code_coverage" = "yes" ], [
- dnl Check if gcc is being used
- AS_IF([ test "$GCC" = "no" ], [
- AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
- ])
-
- # List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10"
-
- AC_CHECK_PROG([LCOV], [lcov], [lcov])
- AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
-
- AS_IF([ test "$LCOV" ], [
- AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
- gnome_cv_lcov_version=invalid
- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
- for lcov_check_version in $lcov_version_list; do
- if test "$lcov_version" = "$lcov_check_version"; then
- gnome_cv_lcov_version="$lcov_check_version (ok)"
- fi
- done
- ])
- ], [
- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
- AC_MSG_ERROR([$lcov_msg])
- ])
-
- case $gnome_cv_lcov_version in
- ""|invalid[)]
- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
- AC_MSG_ERROR([$lcov_msg])
- LCOV="exit 0;"
- ;;
- esac
-
- AS_IF([ test -z "$GENHTML" ], [
- AC_MSG_ERROR([Could not find genhtml from the lcov package])
- ])
-
- dnl Build the code coverage flags
- CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
- CODE_COVERAGE_LDFLAGS="-lgcov"
-
- AC_SUBST([CODE_COVERAGE_CFLAGS])
- AC_SUBST([CODE_COVERAGE_LDFLAGS])
- ])
-
-GNOME_CODE_COVERAGE_RULES='
-# Code coverage
-#
-# Optional:
-# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
-# (Default: $(top_builddir))
-# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
-# by lcov for code coverage. (Default:
-# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
-# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
-# reports to be created. (Default:
-# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
-# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
-# (Default: empty)
-# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
-# instance. (Default: empty)
-# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
-#
-# The generated report will be titled using the $(PACKAGE_NAME) and
-# $(PACKAGE_VERSION). In order to add the current git hash to the title,
-# use the git-version-gen script, available online.
-
-# Optional variables
-CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
-CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
-CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
-CODE_COVERAGE_LCOV_OPTIONS ?=
-CODE_COVERAGE_GENHTML_OPTIONS ?=
-CODE_COVERAGE_IGNORE_PATTERN ?=
-
-code_coverage_quiet = $(code_coverage_quiet_$(V))
-code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
-code_coverage_quiet_0 = --quiet
-
-# Use recursive makes in order to ignore errors during check
-check-code-coverage:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Capture code coverage data
-code-coverage-capture: code-coverage-capture-hook
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
- $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
- -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
- LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
- @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Hook rule executed before code-coverage-capture, overridable by the user
-code-coverage-capture-hook:
-
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
-clean: code-coverage-clean
-code-coverage-clean:
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
- -find . -name "*.gcda" -o -name "*.gcov" -delete
-endif
-
-GITIGNOREFILES ?=
-GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-
-DISTCHECK_CONFIGURE_FLAGS ?=
-DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
-
-.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
-'
-
- AC_SUBST([GNOME_CODE_COVERAGE_RULES])
- m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
-])
-
-dnl GNOME_COMPILE_WARNINGS
-dnl Turn on many useful compiler warnings and substitute the result into
-dnl WARN_CFLAGS
-dnl For now, only works on GCC
-AC_DEFUN([GNOME_COMPILE_WARNINGS],[
- dnl ******************************
- dnl More compiler warnings
- dnl ******************************
-
- AC_ARG_ENABLE(compile-warnings,
- AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
- [Turn on compiler warnings]),,
- [enable_compile_warnings="m4_default([$1],[yes])"])
-
- if test "x$GCC" != xyes; then
- enable_compile_warnings=no
- fi
-
- warning_flags=
- realsave_CFLAGS="$CFLAGS"
-
- dnl These are warning flags that aren't marked as fatal. Can be
- dnl overridden on a per-project basis with -Wno-foo.
- base_warn_flags=" \
- -Wall \
- -Wstrict-prototypes \
- -Wnested-externs \
- "
-
- dnl These compiler flags typically indicate very broken or suspicious
- dnl code. Some of them such as implicit-function-declaration are
- dnl just not default because gcc compiles a lot of legacy code.
- dnl We choose to make this set into explicit errors.
- base_error_flags=" \
- -Werror=missing-prototypes \
- -Werror=implicit-function-declaration \
- -Werror=pointer-arith \
- -Werror=init-self \
- -Werror=format-security \
- -Werror=format=2 \
- -Werror=missing-include-dirs \
- "
-
- case "$enable_compile_warnings" in
- no)
- warning_flags=
- ;;
- minimum)
- warning_flags="-Wall"
- ;;
- yes)
- warning_flags="$base_warn_flags $base_error_flags"
- ;;
- maximum|error)
- warning_flags="$base_warn_flags $base_error_flags"
- ;;
- *)
- AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
- ;;
- esac
-
- if test "$enable_compile_warnings" = "error" ; then
- warning_flags="$warning_flags -Werror"
- fi
-
- dnl Check whether GCC supports the warning options
- for option in $warning_flags; do
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $option"
- AC_MSG_CHECKING([whether gcc understands $option])
- AC_TRY_COMPILE([], [],
- has_option=yes,
- has_option=no,)
- CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT([$has_option])
- if test $has_option = yes; then
- tested_warning_flags="$tested_warning_flags $option"
- fi
- unset has_option
- unset save_CFLAGS
- done
- unset option
- CFLAGS="$realsave_CFLAGS"
- AC_MSG_CHECKING(what warning flags to pass to the C compiler)
- AC_MSG_RESULT($tested_warning_flags)
-
- AC_ARG_ENABLE(iso-c,
- AC_HELP_STRING([--enable-iso-c],
- [Try to warn if code is not ISO C ]),,
- [enable_iso_c=no])
-
- AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
- complCFLAGS=
- if test "x$enable_iso_c" != "xno"; then
- if test "x$GCC" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) complCFLAGS="$complCFLAGS -ansi" ;;
- esac
- case " $CFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) complCFLAGS="$complCFLAGS -pedantic" ;;
- esac
- fi
- fi
- AC_MSG_RESULT($complCFLAGS)
-
- WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
- AC_SUBST(WARN_CFLAGS)
-])
-
-dnl For C++, do basically the same thing.
-
-AC_DEFUN([GNOME_CXX_WARNINGS],[
- AC_ARG_ENABLE(cxx-warnings,
- AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
- [Turn on compiler warnings.]),,
- [enable_cxx_warnings="m4_default([$1],[minimum])"])
-
- AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
- warnCXXFLAGS=
- if test "x$GXX" != xyes; then
- enable_cxx_warnings=no
- fi
- if test "x$enable_cxx_warnings" != "xno"; then
- if test "x$GXX" = "xyes"; then
- case " $CXXFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) warnCXXFLAGS="-Wall -Wno-unused" ;;
- esac
-
- ## -W is not all that useful. And it cannot be controlled
- ## with individual -Wno-xxx flags, unlike -Wall
- if test "x$enable_cxx_warnings" = "xyes"; then
- warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
- fi
- fi
- fi
- AC_MSG_RESULT($warnCXXFLAGS)
-
- AC_ARG_ENABLE(iso-cxx,
- AC_HELP_STRING([--enable-iso-cxx],
- [Try to warn if code is not ISO C++ ]),,
- [enable_iso_cxx=no])
-
- AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
- complCXXFLAGS=
- if test "x$enable_iso_cxx" != "xno"; then
- if test "x$GXX" = "xyes"; then
- case " $CXXFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
- esac
-
- case " $CXXFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
- esac
- fi
- fi
- AC_MSG_RESULT($complCXXFLAGS)
-
- WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
- AC_SUBST(WARN_CXXFLAGS)
-])
-
m4_include([m4/as-ac-expand.m4])
m4_include([m4/jhflags.m4])
m4_include([m4/libtool.m4])
diff --git a/configure b/configure
index 154bac4..b98afbb 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pygobject 3.9.91.
+# Generated by GNU Autoconf 2.69 for pygobject 3.9.92.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pygobject'
PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.9.91'
-PACKAGE_STRING='pygobject 3.9.91'
+PACKAGE_VERSION='3.9.92'
+PACKAGE_STRING='pygobject 3.9.92'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
PACKAGE_URL='https://live.gnome.org/PyGObject/'
@@ -1395,7 +1395,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pygobject 3.9.91 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.9.92 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1465,7 +1465,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pygobject 3.9.91:";;
+ short | recursive ) echo "Configuration of pygobject 3.9.92:";;
esac
cat <<\_ACEOF
@@ -1602,7 +1602,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pygobject configure 3.9.91
+pygobject configure 3.9.92
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1880,7 +1880,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pygobject $as_me 3.9.91, which was
+It was created by pygobject $as_me 3.9.92, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2244,9 +2244,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 9" >>confdefs.h
PYGOBJECT_MINOR_VERSION=9
-$as_echo "#define PYGOBJECT_MICRO_VERSION 91" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 92" >>confdefs.h
-PYGOBJECT_MICRO_VERSION=91
+PYGOBJECT_MICRO_VERSION=92
ac_config_headers="$ac_config_headers config.h"
@@ -2766,7 +2766,7 @@ fi
# Define the identity of the package.
PACKAGE='pygobject'
- VERSION='3.9.91'
+ VERSION='3.9.92'
cat >>confdefs.h <<_ACEOF
@@ -14425,7 +14425,7 @@ $as_echo "$enable_code_coverage" >&6; }
fi
# List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10"
+ lcov_version_list="1.6 1.7 1.8 1.9"
# Extract the first word of "lcov", so it can be a program name with args.
set dummy lcov; ac_word=$2
@@ -14587,7 +14587,7 @@ code_coverage_quiet_0 = --quiet
# Use recursive makes in order to ignore errors during check
check-code-coverage:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
+ifdef CODE_COVERAGE_ENABLED
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
else
@@ -14596,7 +14596,7 @@ endif
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
+ifdef CODE_COVERAGE_ENABLED
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
@@ -14609,13 +14609,11 @@ endif
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
clean: code-coverage-clean
code-coverage-clean:
-$(LCOV) --directory $(top_builddir) -z
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-find . -name "*.gcda" -o -name "*.gcov" -delete
-endif
GITIGNOREFILES ?=
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
@@ -15332,7 +15330,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pygobject $as_me 3.9.91, which was
+This file was extended by pygobject $as_me 3.9.92, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15399,7 +15397,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pygobject config.status 3.9.91
+pygobject config.status 3.9.92
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index f405d4b..d0a41b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ m4_define(python3_min_ver, 3.1)
dnl the pygobject version number
m4_define(pygobject_major_version, 3)
m4_define(pygobject_minor_version, 9)
-m4_define(pygobject_micro_version, 91)
+m4_define(pygobject_micro_version, 92)
m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
dnl versions of packages we require ...
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 0a4cdb6..f4b1ef5 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -536,7 +536,7 @@ __all__.append('MainContext')
class Source(GLib.Source):
- def __new__(cls):
+ def __new__(cls, *args, **kwargs):
# use our custom pyg_source_new() here as g_source_new() is not
# bindable
source = source_new()
diff --git a/gi/overrides/__init__.py b/gi/overrides/__init__.py
index 943ea60..8aa9731 100644
--- a/gi/overrides/__init__.py
+++ b/gi/overrides/__init__.py
@@ -64,6 +64,7 @@ class overridefunc(object):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.__name__ = func.__name__
+ wrapper.__doc__ = func.__doc__
setattr(self.module, func.__name__, wrapper)
return wrapper
diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c
index 82d94a0..57b4126 100644
--- a/gi/pygi-marshal-from-py.c
+++ b/gi/pygi-marshal-from-py.c
@@ -1780,6 +1780,8 @@ _pygi_marshal_from_py_interface_struct (PyObject *py_arg,
gboolean copy_reference,
gboolean is_foreign)
{
+ gboolean is_union = FALSE;
+
if (py_arg == Py_None) {
arg->v_pointer = NULL;
return TRUE;
@@ -1806,41 +1808,27 @@ _pygi_marshal_from_py_interface_struct (PyObject *py_arg,
return (success == Py_None);
} else if (!PyObject_IsInstance (py_arg, py_type)) {
/* first check to see if this is a member of the expected union */
- if (!_is_union_member (interface_info, py_arg)) {
- if (!PyErr_Occurred()) {
- gchar *type_name = _pygi_g_base_info_get_fullname (interface_info);
- PyObject *module = PyObject_GetAttrString(py_arg, "__module__");
-
- PyErr_Format (PyExc_TypeError, "argument %s: Expected %s, but got %s%s%s",
- arg_name ? arg_name : "self",
- type_name,
- module ? PYGLIB_PyUnicode_AsString(module) : "",
- module ? "." : "",
- py_arg->ob_type->tp_name);
- if (module)
- Py_DECREF (module);
- g_free (type_name);
- }
-
- return FALSE;
+ is_union = _is_union_member (interface_info, py_arg);
+ if (!is_union) {
+ goto type_error;
}
}
if (g_type_is_a (g_type, G_TYPE_BOXED)) {
- /* Use pyg_type_from_object to pull the stashed __gtype__ attribute
- * off of the input argument instead of checking PyGBoxed.gtype
- * with pyg_boxed_check. This is needed to work around type discrepancies
- * in cases with aliased (typedef) types. e.g. GtkAllocation, GdkRectangle.
+ /* Additionally use pyg_type_from_object to pull the stashed __gtype__
+ * attribute off of the input argument for type checking. This is needed
+ * to work around type discrepancies in cases with aliased (typedef) types.
+ * e.g. GtkAllocation, GdkRectangle.
* See: https://bugzilla.gnomethere are .org/show_bug.cgi?id=707140
*/
- if (g_type_is_a (pyg_type_from_object (py_arg), g_type)) {
+ if (is_union || pyg_boxed_check (py_arg, g_type) ||
+ g_type_is_a (pyg_type_from_object (py_arg), g_type)) {
arg->v_pointer = pyg_boxed_get (py_arg, void);
if (transfer == GI_TRANSFER_EVERYTHING) {
arg->v_pointer = g_boxed_copy (g_type, arg->v_pointer);
}
} else {
- PyErr_Format (PyExc_TypeError, "wrong boxed type");
- return FALSE;
+ goto type_error;
}
} else if (g_type_is_a (g_type, G_TYPE_POINTER) ||
@@ -1862,4 +1850,21 @@ _pygi_marshal_from_py_interface_struct (PyObject *py_arg,
return FALSE;
}
return TRUE;
+
+type_error:
+ {
+ gchar *type_name = _pygi_g_base_info_get_fullname (interface_info);
+ PyObject *module = PyObject_GetAttrString(py_arg, "__module__");
+
+ PyErr_Format (PyExc_TypeError, "argument %s: Expected %s, but got %s%s%s",
+ arg_name ? arg_name : "self",
+ type_name,
+ module ? PYGLIB_PyUnicode_AsString(module) : "",
+ module ? "." : "",
+ py_arg->ob_type->tp_name);
+ if (module)
+ Py_DECREF (module);
+ g_free (type_name);
+ return FALSE;
+ }
}
diff --git a/tests/test_source.py b/tests/test_source.py
index 5b3b51b..d0e28e4 100644
--- a/tests/test_source.py
+++ b/tests/test_source.py
@@ -214,6 +214,17 @@ class TestSource(unittest.TestCase):
del source
self.assertTrue(self.finalized)
+ def test_extra_init_args(self):
+ class SourceWithInitArgs(GLib.Source):
+ def __init__(self, arg, kwarg=None):
+ super(SourceWithInitArgs, self).__init__()
+ self.arg = arg
+ self.kwarg = kwarg
+
+ source = SourceWithInitArgs(1, kwarg=2)
+ self.assertEqual(source.arg, 1)
+ self.assertEqual(source.kwarg, 2)
+
class TestUserData(unittest.TestCase):
def test_idle_no_data(self):