From 43b787d76aa1d28c0c529eb5e4d25397fc4f2ab0 Mon Sep 17 00:00:00 2001 From: Dave Warnock Date: Fri, 29 Nov 2024 00:20:41 +0000 Subject: [PATCH] Use Union for Python 3.8 compatibility --- robyn/reloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robyn/reloader.py b/robyn/reloader.py index cdc59d72..47233ee4 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -4,7 +4,7 @@ import subprocess import sys import time -from typing import List +from typing import List, Union from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer @@ -115,7 +115,7 @@ class EventHandler(FileSystemEventHandler): def __init__(self, file_path: str, directory_path: str) -> None: self.file_path = file_path self.directory_path = directory_path - self.process: subprocess.Popen[bytes] | None = None # Keep track of the subprocess + self.process: Union[subprocess.Popen[bytes], None] = None # Keep track of the subprocess self.built_rust_binaries: List = [] # Keep track of the built rust binaries self.last_reload = time.time() # Keep track of the last reload. EventHandler is initialized with the process.