mirror of
https://github.com/django/django.git
synced 2025-08-26 21:44:31 +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:
parent
8b2515a450
commit
6e4c6281db
66 changed files with 351 additions and 207 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue