mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."
This reverts commit 550cb3a365
because try/except performs better.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import datetime
|
||||
import uuid
|
||||
from contextlib import suppress
|
||||
from decimal import Decimal
|
||||
|
||||
from django.core import exceptions, serializers
|
||||
@@ -12,9 +11,11 @@ from django.utils.html import escape
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import JSONModel
|
||||
|
||||
with suppress(ImportError):
|
||||
try:
|
||||
from django.contrib.postgres import forms
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@skipUnlessDBFeature('has_jsonb_datatype')
|
||||
|
||||
Reference in New Issue
Block a user