Update PyGObject example with locale fixup workaround

Closes #150
This commit is contained in:
jaseg 2021-03-19 10:47:25 +01:00 committed by GitHub
parent 3105db35a4
commit 03e847d8a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -321,6 +321,11 @@ PyGObject embedding
if __name__ == '__main__':
# This is necessary since like Qt, Gtk stomps over the locale settings needed by libmpv.
# Like with Qt, this needs to happen after importing Gtk but before creating the first mpv.MPV instance.
import locale
locale.setlocale(locale.LC_NUMERIC, 'C')
application = MainClass()
Gtk.main()