Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fixing the bug in logic of object's string representation. #1327

Merged
merged 1 commit into from
Feb 21, 2013
Merged

Fixing the bug in logic of object's string representation. #1327

merged 1 commit into from
Feb 21, 2013

Conversation

oozie
Copy link
Contributor

@oozie oozie commented Feb 17, 2013

The __repr__ method incorrectly assumes a presence of a string in the name attribute of an SWFBase object. When an object has an empty name (used to set worker's identity in SWF) and a version attribute exists on it, the following happens:

>>> from boto.swf.layer2 import Decider
>>> Decider(version=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "boto/swf/layer2.py", line 46, in __repr__
    rep_str += '-' + getattr(self, 'version')
TypeError: cannot concatenate 'str' and 'NoneType' objects
>>> 

With this fix, the undesider behavior goes away.

>>> from boto.swf.layer2 import Decider
>>> Decider(version=None)
<Decider 'None-None' at 0x7fb3745d9390>
>>>

garnaat added a commit that referenced this pull request Feb 21, 2013
Fixing the bug in logic of object's string representation.
@garnaat garnaat merged commit 60df2a8 into boto:develop Feb 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants