  
  # location of patterns, url, include changes in 1.4 onwards
  try:
      from django.conf.urls import patterns, url, include
  except:
      from django.conf.urls.defaults import patterns, url, include
  
  # Handle django.utils.encoding rename:
  # smart_unicode -> smart_text
  # force_unicode -> force_text
 
</s> remove except:
 </s> add except ImportError: </s> remove except:
 </s> add except ImportError: </s> remove     except:  # Django 1.3
 </s> add     except ImportError:  # Django 1.3 </s> remove             except:
 </s> add             except Exception:
except ImportError:
  
  # location of patterns, url, include changes in 1.4 onwards
  try:
      from django.conf.urls import patterns, url, include
except ImportError:
      from django.conf.urls.defaults import patterns, url, include
  
  # Handle django.utils.encoding rename:
  # smart_unicode -> smart_text
  # force_unicode -> force_text
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