To reproduce, create a fabfile.py with contents "class Foo(Exception): pass", then "fab -l" will list it as an available command.
I suppose this happens because callable(Foo) is True, but since using an Exception as a fabric command is nonsense, I would expect this to generate an error like "Fatal error: Fabfile didn't contain any commands!" just like if I had a fabfile consisting only of contents "Foo=",
For real fabfiles, this clutters up the namespace and it's annoying to have to do the "from module import SomeException as _SomeException" workaround.
Gross. Thanks for the catch.
No problem. Since we agree it's a bug now, I'll volunteer to create a patch.
Edit: PR #1372
Rolling into PR.