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:
@@ -2,7 +2,6 @@ import decimal
|
||||
import json
|
||||
import unittest
|
||||
import uuid
|
||||
from contextlib import suppress
|
||||
|
||||
from django import forms
|
||||
from django.core import exceptions, serializers, validators
|
||||
@@ -20,11 +19,13 @@ from .models import (
|
||||
PostgreSQLModel, Tag,
|
||||
)
|
||||
|
||||
with suppress(ImportError):
|
||||
try:
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from django.contrib.postgres.forms import (
|
||||
SimpleArrayField, SplitArrayField, SplitArrayWidget,
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class TestSaveLoad(PostgreSQLTestCase):
|
||||
|
||||
Reference in New Issue
Block a user