Skip to content

Commit

Permalink
Fix unit tests when run with Python 3.12
Browse files Browse the repository at this point in the history
When running in command line mode, the Gedcom and ProGen importers
were being run before the `gi.require_version` method, causing
Gtk 4.0 to be incorrectly loaded. This caused some unit tests to
fail.

Fixes #13212.
  • Loading branch information
Nick-Hall committed Mar 9, 2024
1 parent 8361567 commit 3749fad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gramps/plugins/importer/importgedcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

_ = glocale.translation.gettext
from gramps.gen.errors import DbError, GedcomError
from gramps.gui.glade import Glade
from gramps.plugins.lib.libmixin import DbMixin
from gramps.plugins.lib import libgedcom
from gramps.gen.utils.libformatting import ImportInfo
Expand Down Expand Up @@ -98,6 +97,7 @@ def importData(database, filename, user):
return

if not gramps and ansel and user.uistate:
from gramps.gui.glade import Glade
top = Glade()
code = top.get_object("codeset")
code.set_active(0)
Expand Down
2 changes: 2 additions & 0 deletions gramps/plugins/importer/importprogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#
# -------------------------------------------------------------------------
import os, time
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk

# ------------------------------------------------------------------------
Expand Down

0 comments on commit 3749fad

Please sign in to comment.