1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().

This commit is contained in:
Mads Jensen
2017-03-09 16:17:41 +01:00
committed by Tim Graham
parent 43a4835edf
commit 550cb3a365
67 changed files with 223 additions and 368 deletions

View File

@@ -1,4 +1,5 @@
import json
from contextlib import suppress
from django.core import exceptions, serializers
from django.forms import Form
@@ -7,12 +8,10 @@ from django.test.utils import modify_settings
from . import PostgreSQLTestCase
from .models import HStoreModel
try:
with suppress(ImportError):
from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import KeysValidator
except ImportError:
pass
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})