def is_fp_closed(obj):
 try:
  return obj.isclosed()
 except AttributeError:
  pass
 try:
  return obj.closed
 except AttributeError:
  pass
 try:
  return (obj.fp is None)
 except AttributeError:
  pass
 raise ValueError('Unable to determine whether fp is closed.')

def is_fp_closed ( obj ) : try : return obj . isclosed ( ) except AttributeError : pass try : return obj . closed except AttributeError : pass try : return ( obj . fp is None ) except AttributeError : pass raise ValueError ( 'Unable to determine whether fp is closed.' )
checks whether a given file-like object is closed .