Author: bugman Date: Tue Apr 17 11:48:24 2012 New Revision: 15747 URL: http://svn.gna.org/viewcvs/relax?rev=15747&view=rev Log: Multiple unregistrations of observer methods are now possible without a RelaxError. This allows multiple code paths to unregister methods to allow for pre-removal of methods to avoid queued wx events in wxGTK from occurring on dead or missing objects. Modified: 1.3/status.py Modified: 1.3/status.py URL: http://svn.gna.org/viewcvs/relax/1.3/status.py?rev=15747&r1=15746&r2=15747&view=diff ============================================================================== --- 1.3/status.py (original) +++ 1.3/status.py Tue Apr 17 11:48:24 2012 @@ -441,13 +441,15 @@ @type key: str """ - # Does not exist. + # Debugging. + if self._status.debug: + sys.stdout.write("debug> Observer: '%s' unregistering '%s'.\n" % (self._name, key)) + + # Does not exist, so return (allow multiple code paths to unregister methods). if key not in self._keys: - raise RelaxError("The key '%s' does not exist." % key) - - # Debugging. - if self._status.debug: - sys.stdout.write("debug> Observer: '%s' unregistering '%s'.\n" % (self._name, key)) + if self._status.debug: + sys.stdout.write("debug> The key '%s' does not exist." % key) + return # Remove the method from the dictionary of callbacks. self._callback.pop(key)