Skip to content

Commit

Permalink
Fixing for py38
Browse files Browse the repository at this point in the history
  • Loading branch information
karolyi committed Aug 1, 2024
1 parent ba4ae50 commit d077bf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions debug_toolbar/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import re
import uuid
from collections import OrderedDict
from functools import lru_cache
from typing import OrderedDict

from django.apps import apps
from django.conf import settings
Expand All @@ -16,9 +16,11 @@
from django.urls import include, path, re_path, resolve
from django.urls.exceptions import Resolver404
from django.utils.module_loading import import_string
from django.utils.translation import get_language, override as lang_override
from django.utils.translation import get_language
from django.utils.translation import override as lang_override

from debug_toolbar import APP_NAME, settings as dt_settings
from debug_toolbar import APP_NAME
from debug_toolbar import settings as dt_settings
from debug_toolbar.panels import Panel


Expand Down
4 changes: 2 additions & 2 deletions tests/test_csp_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from .base import BaseTestCase


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


Expand Down

0 comments on commit d077bf4

Please sign in to comment.