Hooks broken in Python 3 #73

Closed
derks opened this Issue Nov 7, 2011 · 0 comments

Comments

Projects
None yet
1 participant
@derks
Member

derks commented Nov 7, 2011

Having two functions registered to the same hook results in a TypeError when backend.hook attempts to order the tuples:

Traceback (most recent call last):
  File "test.py", line 7, in 
    app.setup()
  File "/Users/wdierkes/devel/cement/src/cement2/cement2/core/foundation.py", line 87, in setup
    for res in hook.run('cement_post_setup_hook', self):
  File "/Users/wdierkes/devel/cement/src/cement2/cement2/core/hook.py", line 120, in run
    backend.hooks[name].sort() # Will order based on weight
TypeError: unorderable types: function() < function()

In python 3 it appears the entire tuple is compared rather than just the first item in the tuple (weight) in Python < 3.

@ghost ghost assigned derks Nov 7, 2011

derks pushed a commit that referenced this issue Nov 7, 2011

@derks derks closed this Nov 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment