  
  # django-filter is optional
  try:
      import django_filters
  except:
      django_filters = None
  
  
  # cStringIO only if it's available, otherwise StringIO
  try:
 
</s> remove except:
 </s> add except ImportError: </s> remove except:
 </s> add except ImportError: </s> remove         except:
 </s> add         except Exception: </s> remove     except:
 </s> add     except NoReverseMatch: </s> remove     except:
 </s> add     except NoReverseMatch:
except ImportError:
  
  # django-filter is optional
  try:
      import django_filters
except ImportError:
      django_filters = None
  
  
  # cStringIO only if it's available, otherwise StringIO
  try:
keep keep keep keep replace keep keep keep keep keep
 Purge naked excepts.

Most of these had obvious exceptions which would be thrown. Some I'm not
sure about but they should at least catch only Exception so as not to
ignore SystemExit and other inappropriate Error classes. 
rest_framework/compat.py