[pygobject/pygobject-3-4] Fix Gdk.Atom str()/repr() fallback



commit 41e675ad213f3f24128b5ab338aeaf05f8a9db8e
Author: Martin Pitt <martinpitt gnome org>
Date:   Tue Nov 13 16:38:36 2012 +0100

    Fix Gdk.Atom str()/repr() fallback
    
    Fix regression in commit 6713618: If an atom does not have a name, do not
    recursively call our own str()/repr() methods, but just print
    "Gdk.Atom<atom_id>".

 gi/overrides/Gdk.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index 0571c40..63f1467 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -352,14 +352,16 @@ def _gdk_atom_str(atom):
     n = atom.name()
     if n:
         return n
-    return Gdk.Atom.__str__(n)
+    # fall back to atom index
+    return 'Gdk.Atom<%i>' % hash(atom)
 
 
 def _gdk_atom_repr(atom):
     n = atom.name()
     if n:
         return 'Gdk.Atom<%s>' % n
-    return Gdk.Atom.__str__(n)
+    # fall back to atom index
+    return 'Gdk.Atom<%i>' % hash(atom)
 
 
 Gdk.Atom.__str__ = _gdk_atom_str



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]