Skip to content

Commit e371a9c

Browse files
committed
fix: some more checks
1 parent 299baa0 commit e371a9c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

json2xml/dicttoxml.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from collections.abc import Callable, Sequence
77
from random import SystemRandom
88
from typing import Any, Union
9+
from xml.parsers.expat import ExpatError
910

1011
from defusedxml.minidom import parseString
11-
from xml.parsers.expat import ExpatError
1212

1313
# Create a safe random number generator
1414

@@ -191,7 +191,7 @@ def default_item_func(parent: str) -> str:
191191
def _build_namespace_string(xml_namespaces: dict[str, Any]) -> str:
192192
"""Build XML namespace string from namespace dictionary."""
193193
parts = []
194-
194+
195195
for prefix, value in xml_namespaces.items():
196196
if prefix == 'xsi' and isinstance(value, dict):
197197
for schema_att, ns in value.items():
@@ -203,7 +203,7 @@ def _build_namespace_string(xml_namespaces: dict[str, Any]) -> str:
203203
parts.append(f'xmlns="{value}"')
204204
else:
205205
parts.append(f'xmlns:{prefix}="{value}"')
206-
206+
207207
return ' ' + ' '.join(parts) if parts else ''
208208

209209

@@ -701,7 +701,7 @@ def dicttoxml(
701701
"""
702702
if xml_namespaces is None:
703703
xml_namespaces = {}
704-
704+
705705
output = []
706706
namespace_str = _build_namespace_string(xml_namespaces)
707707
if root:

tests/test_dict2xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import datetime
2-
from typing import TYPE_CHECKING, Any
2+
from typing import Any
33

44
import pytest
55

tests/test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Test module for json2xml.utils functionality."""
22
import json
33
import tempfile
4-
from typing import TYPE_CHECKING
54
from unittest.mock import Mock, patch
65

76
import pytest

0 commit comments

Comments
 (0)