MCPcopy
hub / github.com/benoitc/gunicorn / has_fileno

Function has_fileno

gunicorn/util.py:623–633  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

621
622
623def has_fileno(obj):
624 if not hasattr(obj, "fileno"):
625 return False
626
627 # check BytesIO case and maybe others
628 try:
629 obj.fileno()
630 except (AttributeError, OSError, io.UnsupportedOperation):
631 return False
632
633 return True
634
635
636def warn(msg):

Callers

nothing calls this directly

Calls 1

filenoMethod · 0.45

Tested by

no test coverage detected