🐛 修复一些类型错误

This commit is contained in:
Azide
2023-09-12 15:50:07 +08:00
committed by felinae98
parent ffa180e8a6
commit 77e9fc3b50
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -46,7 +46,9 @@ def update_time_feed_1():
root = ET.fromstring(file)
item = root.find("channel/item")
current_time = datetime.now(pytz.timezone("GMT")).strftime("%a, %d %b %Y %H:%M:%S %Z")
assert item is not None
pubdate_elem = item.find("pubDate")
assert pubdate_elem is not None
pubdate_elem.text = current_time
return ET.tostring(root, encoding="unicode")
@@ -57,6 +59,7 @@ def update_time_feed_2():
root = ET.fromstring(file)
current_time = datetime.now(pytz.timezone("GMT")).strftime("%a, %d %b %Y %H:%M:%S %Z")
published_element = root.find(".//{*}published")
assert published_element is not None
published_element.text = current_time
return ET.tostring(root, encoding="unicode")