1
0
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:
Tim Graham
2017-09-07 08:16:21 -04:00
committed by GitHub
parent 8b2515a450
commit 6e4c6281db
66 changed files with 351 additions and 207 deletions

View File

@@ -4,7 +4,6 @@ A series of tests to establish that the command-line bash completion works.
import os
import sys
import unittest
from contextlib import suppress
from django.apps import apps
from django.core.management import ManagementUtility
@@ -51,8 +50,10 @@ class BashCompletionTests(unittest.TestCase):
def _run_autocomplete(self):
util = ManagementUtility(argv=sys.argv)
with captured_stdout() as stdout:
with suppress(SystemExit):
try:
util.autocomplete()
except SystemExit:
pass
return stdout.getvalue().strip().split('\n')
def test_django_admin_py(self):