From 2b57eb8c9829f033c3a7932a0fa885d1c1dceed1 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Thu, 22 Sep 2022 20:33:03 -0700 Subject: [PATCH] Downgrade required Python version from 3.10 to 3.8 Python 3.10 was require because I was using the `str | None` style typing syntax instead of Optional. This is 3.10+, but now the max required version is 3.8 for the `Protocol` typing API. Signed-off-by: Alek Ratzloff --- markup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/markup.py b/markup.py index f6dbbbb..7c30d77 100755 --- a/markup.py +++ b/markup.py @@ -18,7 +18,7 @@ import functools import random import re import string -from typing import Protocol +from typing import Optional, Protocol NAME_CHARS = string.ascii_letters + string.digits @@ -196,7 +196,7 @@ class MarkupParser: ################################################################################ -def render(text: str, ctx: MarkupContext | None = None) -> str: +def render(text: str, ctx: Optional[MarkupContext] = None) -> str: if not ctx: ctx = default_context() assert ctx @@ -210,7 +210,7 @@ def render(text: str, ctx: MarkupContext | None = None) -> str: def macro_random( - ctx: MarkupContext, first: str | None = None, second: str | None = None, *tail: str + ctx: MarkupContext, first: Optional[str] = None, second: Optiona[str] = None, *tail: str ) -> str: """ Choose a random number. @@ -237,7 +237,7 @@ def macro_choose(ctx: MarkupContext, *choices: str): return random.choice(choices) -def macro_round(ctx: MarkupContext, n: str, digits: str | None = None) -> str: +def macro_round(ctx: MarkupContext, n: str, digits: Optional[str] = None) -> str: "round() function, same as Python's." if digits: res = round(float(n), int(digits))