From 7763be83104726790e06d681700925aebcc7cc97 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Fri, 25 Sep 2020 17:14:47 -0400 Subject: [PATCH] Fix loop Heroku --- worker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.py b/worker.py index 224c4fc..25f50c8 100644 --- a/worker.py +++ b/worker.py @@ -1,6 +1,7 @@ from os import system from os.path import isfile from sys import exit +from importlib.util import find_spec HEROKU = False if isfile("../Procfile") and isfile("../requirements.txt"): @@ -8,7 +9,7 @@ if isfile("../Procfile") and isfile("../requirements.txt"): HEROKU = True if HEROKU: - if not "aioquic" in open("../requirements.txt").read(): + if find_spec("aioquic") is None: print("Installing aioquic on this Heroku instance since it wasn't installed on deploy...") system("python3 -m pip install --user aioquic") system("python3 worker.py")