From f7e2b7884acfa9cb5797f84abafddd8b694159de Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 19 Jun 2024 18:58:48 -0400 Subject: [PATCH] Python examples: use gi.require_version("Secret", "1") This is the standard mechanism to initialize a GObject introspectable interface. If you don't do this, you get this PyGIWarning: Secret was imported without specifying a version first. Use gi.require_version('Secret', '1') before import to ensure that the right version gets loaded. --- docs/reference/libsecret/libsecret-using.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/libsecret/libsecret-using.md b/docs/reference/libsecret/libsecret-using.md index a8e80c8..e2d4e93 100644 --- a/docs/reference/libsecret/libsecret-using.md +++ b/docs/reference/libsecret/libsecret-using.md @@ -53,6 +53,8 @@ var schema = new Secret.Schema.new("org.mock.Schema", In python use the standard introspection import mechanism to get at libsecret: ```python +import gi +gi.require_version("Secret", "1") from gi.repository import Secret # ... and a here's sample line of code which uses the import