1. Georg Brandl
  2. sphinx-contrib

Pull requests

#61 Merged
Repository
daveshawley
Branch
default
Repository
birkenfeld
Branch
default

httpdomain: Make autohttp.tornado work in Python 3.x.

Author
  1. Dave Shawley
Reviewers
Description

The get_routes function in autohttp.tornado used inspect.ismethod on the handler class to detect implemented instance methods. This does not work in Python 3.x. I changed the implementation to:

  • loop over handler.SUPPORTED_METHODS
  • retrieve getattr(handler, method.lower())
  • if it is either an function or method, then yield a tuple for it - detection here is by inspect.isfunction and inspect.ismethod

This should be faster, safer, and it works on 2.6, 2.7, 3.3, and 3.4.

  • Learn about pull requests

Comments (1)