Commits

Ginés Martínez Sánchez committed ef5d766

_urandom_name need to be a global variable

Comments (0)

Files changed (1)

     '_tab': [None, None, 0, None, ''],
 }
 
+_urandom_name = 0
+
 
 class GObj(SMachine, GConfig):
     """ Well, yes, I'm a very simple brain. Only a machine.
     :param gconfig: GCONFIG :term:`gconfig-template`.
     """
 
-    _urandom_name = 0
-
     def __init__(self, fsm, gconfig=None):
         SMachine.__init__(self, fsm)
         self.name = ''
         return gobj
 
     def get_random_name(self, prefix):
-        self._urandom_name += 1
-        return '%s_%d' % (prefix, self._urandom_name)
+        global _urandom_name
+        _urandom_name += 1
+        return '%s_%d' % (prefix, _urandom_name)
 
     def create_random_named_gobj(self, name, gclass, parent, **kw):
         """ Same as :meth:`create_gobj` function,