Skip to content

Commit 64041b6

Browse files
committed
Fixing for py38
1 parent ba4ae50 commit 64041b6

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

debug_toolbar/toolbar.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import re
66
import uuid
7-
from collections import OrderedDict
87
from functools import lru_cache
8+
from typing import OrderedDict
99

1010
from django.apps import apps
1111
from django.conf import settings
@@ -16,9 +16,11 @@
1616
from django.urls import include, path, re_path, resolve
1717
from django.urls.exceptions import Resolver404
1818
from django.utils.module_loading import import_string
19-
from django.utils.translation import get_language, override as lang_override
19+
from django.utils.translation import get_language
20+
from django.utils.translation import override as lang_override
2021

21-
from debug_toolbar import APP_NAME, settings as dt_settings
22+
from debug_toolbar import APP_NAME
23+
from debug_toolbar import settings as dt_settings
2224
from debug_toolbar.panels import Panel
2325

2426

tests/test_csp_rendering.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,20 @@
1010
from .base import BaseTestCase
1111

1212

13-
def _get_ns(element: Element) -> dict[str, str]:
13+
def _get_ns(element: Element) -> Dict[str, str]:
1414
"""
1515
Return the default `xmlns`. See
1616
https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-namespaces
1717
"""
1818
if not element.tag.startswith('{'):
19-
return dict()
19+
return {}
2020
return {'': element.tag[1:].split('}', maxsplit=1)[0]}
2121

2222

2323
class CspRenderingTestCase(BaseTestCase):
2424
'Testing if `csp-nonce` renders.'
2525
panel_id = "StaticFilesPanel"
2626

27-
# def setUp(self):
28-
# self.factory = RequestFactory()
29-
# self.async_factory = AsyncRequestFactory()
30-
3127
def _fail_if_missing(
3228
self, root: Element, path: str, namespaces: Dict[str, str],
3329
nonce: str):

0 commit comments

Comments
 (0)