__conform__ should not require a store

Bug #1118498 reported by Laurens Van Houtven
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Divmod
Fix Released
Medium
Laurens Van Houtven

Bug Description

 Empowered.__conform__ gives up if there is no store. That makes sense
for persisted powerups (obviously), but it means that the following
doesn't work:

    >>> rodimus = Transformer(name=u"Rodimus Prime", damage=50)
    >>> hotRod = HotRod(color=u"Red and yellow")
    >>> rodimus.inMemoryPowerUp(hotRod, ICar)
    >>> assert ICar(rodimus) is hotRod
    Traceback (most recent call last):
    ...
    TypeError: ('Could not adapt', ...)

You can see this in action here:
https://travis-ci.org/lvh/axiombook/builds/4628027

The reason it doesn't work is that __conform__ craps out.

I think this is a bug, because the docstring for __conform__ appears
to suggest that it should just use the first powerup from powerupsFor;
but that uses _inMemoryPowerups before looking at stored powerups,
exactly as the inMemoryPowerup docstring suggests as well.

Related branches

Changed in divmod.org:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Laurens Van Houtven (lvh) wrote :

Does anything still needs to happen for this to be able to be merged? ISTR that this was hashed out on the mailing list and that it was good to go.

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

In fact this was merged, I just forgot to close the bug.

Changed in divmod.org:
status: In Progress → Fix Committed
Changed in divmod.org:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.