mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().
This commit is contained in:
parent
43a4835edf
commit
550cb3a365
67 changed files with 223 additions and 368 deletions
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
import uuid
|
||||
from contextlib import suppress
|
||||
from decimal import Decimal
|
||||
|
||||
from django.core import exceptions, serializers
|
||||
|
@ -11,11 +12,9 @@ from django.utils.html import escape
|
|||
from . import PostgreSQLTestCase
|
||||
from .models import JSONModel
|
||||
|
||||
try:
|
||||
with suppress(ImportError):
|
||||
from django.contrib.postgres import forms
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@skipUnlessDBFeature('has_jsonb_datatype')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue