Make 'requirements.txt' be read from module's own...

... directory
This commit is contained in:
CaitSith2 2020-01-19 12:50:04 -08:00 committed by GitHub
parent fe2ebe9883
commit 863689c7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import os
import sys
import subprocess
import importlib
@ -11,7 +12,7 @@ def update():
global update_ran
if not update_ran:
update_ran = True
with open('requirements.txt') as requirementsfile:
with open(os.path.join(os.path.dirname(__file__),'requirements.txt')) as requirementsfile:
for line in requirementsfile.readlines():
module, remoteversion = line.split(">=")
try:
@ -33,4 +34,4 @@ def update():
update_command()
if __name__ == "__main__":
update()
update()