Commits

Benjamin Pollack committed 8db39c8

we're already using inspect; remove use of types and isinstance

  • Participants
  • Parent commits 612b3e6

Comments (0)

Files changed (1)

piston/emitters.py

 from __future__ import generators
 
-import types, decimal, types, re, inspect
+import decimal, re, inspect
 
 try:
     # yaml isn't standard with python.  It shouldn't be required if it
                 ret = _model(thing, fields=fields)
             elif isinstance(thing, HttpResponse):
                 raise HttpStatusCode(thing.content, code=thing.status_code)
-            elif isinstance(thing, types.FunctionType):
+            elif inspect.isfunction(thing):
                 if not inspect.getargspec(thing)[0]:
                     ret = _any(thing())
             elif hasattr(thing, '__emittable__'):