From 1618b3ac81b48f539f99184fbb45b8726a7ffd15 Mon Sep 17 00:00:00 2001 From: FL550 Date: Thu, 22 Aug 2024 17:35:15 +0000 Subject: [PATCH] Fix possible segfault --- setup.py | 8 ++++---- simple_dwd_weatherforecast/dwdforecast.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index e1c10c6..9769209 100644 --- a/setup.py +++ b/setup.py @@ -5,20 +5,20 @@ setuptools.setup( name="simple_dwd_weatherforecast", - version="2.0.32", + version="2.0.33", author="Max Fermor", description="A simple tool to retrieve a weather forecast from DWD OpenData", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/FL550/simple_dwd_weatherforecast.git", packages=setuptools.find_packages(), - package_data={'': ['stations.json', 'uv_stations.json']}, + package_data={"": ["stations.json", "uv_stations.json"]}, include_package_data=True, classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires='>=3.6', - install_requires=['lxml','requests', 'Pillow', 'arrow'] + python_requires=">=3.6", + install_requires=["lxml", "requests", "Pillow", "arrow"], ) diff --git a/simple_dwd_weatherforecast/dwdforecast.py b/simple_dwd_weatherforecast/dwdforecast.py index cbf8e92..90162f8 100644 --- a/simple_dwd_weatherforecast/dwdforecast.py +++ b/simple_dwd_weatherforecast/dwdforecast.py @@ -752,9 +752,9 @@ def parse_placemark(self, stream): ): item = placemark.find(".//kml:name", namespaces=self.namespaces) - if item.text == self.station_id: + if item is not None and item.text == self.station_id: return placemark - placemark.clear() + # placemark.clear() def parse_issue_time(self, tree): issue_time_new = arrow.get(