Fix a crash during patching when MySQL support isn't available.

Review Request #12070 — Created Feb. 21, 2022 and submitted

chipx86
Django Evolution
release-2.x
django-evolution

Django Evolution 2.1.3 introduced a patch for modern versions of
mysqlclient on Django < 2.0. The patch tried to handle the situation
where mysqlclient wasn't installed, but it didn't catch the right
exception.

This change adds a more broad exception handler, and also exception
handlers in the patch loader, one wrapping needs_patch() and one
wrapping apply_patch(). This will help us avoid other unforeseen
issues in the future.

Ran all unit tests without mysqlclient installed.

Summary
Fix a crash during patching when MySQL support isn't available.
Description From Last Updated

F841 local variable 'needs_patch' is assigned to but never used

reviewbotreviewbot

F401 'django.core.exceptions.ImproperlyConfigured' imported but unused

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.1.x (9c35ac6)
Loading...