Skip to content

Commit b3bb03e

Browse files
KI7MTclaude
andcommitted
fix: ElementTree deprecation warning in XML parser (v0.2.1)
- Replace `or` with explicit `is not None` check in _find() - Fixes DeprecationWarning on Python 3.12+ ElementTree truth testing - Bump version 0.2.0 → 0.2.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a8f8395 commit b3bb03e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "qrz-mcp"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "MCP server for QRZ.com — callsign lookup, DXCC resolution, logbook queries"
55
readme = "README.md"
66
license = {text = "GPL-3.0-or-later"}

src/qrz_mcp/xml_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919

2020
def _find(root: ET.Element, tag: str) -> ET.Element | None:
2121
"""Find child element, trying with and without QRZ namespace."""
22-
return root.find(f"{{{_NS}}}{tag}") or root.find(tag)
22+
elem = root.find(f"{{{_NS}}}{tag}")
23+
if elem is not None:
24+
return elem
25+
return root.find(tag)
2326

2427

2528
def _findtext(node: ET.Element, tag: str) -> str:

0 commit comments

Comments
 (0)