home · contact · privacy
Minor typing fix.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 11 Nov 2024 07:42:00 +0000 (08:42 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 11 Nov 2024 07:42:00 +0000 (08:42 +0100)
ytplom.py

index 320872c655258ca93e7ded25f896b7d1524d634e..37c73ef103661505d39e7dca670a670d9f686d91 100755 (executable)
--- a/ytplom.py
+++ b/ytplom.py
@@ -254,12 +254,12 @@ class TaskHandler(BaseHTTPRequestHandler):
             with open(file.path, 'r', encoding='utf8') as query_file:
                 filed_query: QueryData = json_load(query_file)
             assert isinstance(filed_query['results'], list)
-            assert type(filed_query['text']) is QueryText
-            assert type(filed_query['retrieved_at']) is DatetimeStr
+            assert isinstance(filed_query['text'], str)
+            assert isinstance(filed_query['retrieved_at'], str)
             id_ = QueryId(splitext(basename(file.path))[0])
             results_list = filed_query['results']
-            query_text = filed_query['text']
-            retrieved_at = filed_query['retrieved_at']
+            query_text = QueryText(filed_query['text'])
+            retrieved_at = DatetimeStr(filed_query['retrieved_at'])
             queries_data += [(id_, results_list, query_text, retrieved_at)]
         return queries_data