Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrun.py
More file actions
Latest commit
33 lines (26 loc) · 1.19 KB
/
Copy pathrun.py
File metadata and controls
33 lines (26 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
importsubprocess
importsys
DEFAULT_LOGGER='rlbot'
if__name__=='__main__':
try:
fromrlbot.utilsimportpublic_utils, logging_utils
logger=logging_utils.get_logger(DEFAULT_LOGGER)
ifnotpublic_utils.have_internet():
logger.log(logging_utils.logging_level,
'Skipping upgrade check for now since it looks like you have no internet')
elifpublic_utils.is_safe_to_upgrade():
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt'])
subprocess.call([sys.executable, "-m", "pip", "install", 'rlbot', '--upgrade'])
# https://stackoverflow.com/a/44401013
rlbots= [moduleformoduleinsys.modulesifmodule.startswith('rlbot')]
forrlbot_moduleinrlbots:
sys.modules.pop(rlbot_module)
exceptImportError:
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])
try:
fromrlbotimportrunner
runner.main()
exceptExceptionase:
print("Encountered exception: ", e)
print("Press enter to close.")
input()