Skip to content

Commit 47ef0d1

Browse files
committed
Fix Python 3.9 compatibility
Fixes #1395
1 parent 353501c commit 47ef0d1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

puppetboard/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import logging
44
import sys
5-
from typing import Any
5+
from typing import Any, Union
66

77
from flask import abort, request, url_for
88
from packaging.version import parse
@@ -163,7 +163,7 @@ def is_a_test():
163163
return running_in_shell or running_in_intellij
164164

165165

166-
def dot_lookup(_dict: dict[str, Any], lookup: str) -> str | dict | None:
166+
def dot_lookup(_dict: dict[str, Any], lookup: str) -> Union[str, dict, None]:
167167
"""Recursively look up a value in a dictionary using dot notation string"""
168168
lookup_parts = lookup.split(".")
169169
if not lookup_parts:
@@ -237,7 +237,7 @@ def get_all_fact_paths(facts_dict: dict[str, Any]) -> list[str]:
237237
return sorted(all_paths)
238238

239239

240-
def split_fact_path(fact_path: str) -> tuple[str, str | None]:
240+
def split_fact_path(fact_path: str) -> tuple[str, Union[str, None]]:
241241
"""
242242
Split a dot-notation fact path into base fact name and sub-path.
243243

0 commit comments

Comments
 (0)