Skip to content

Commit

Permalink
Apparently both can break on Py3
Browse files Browse the repository at this point in the history
but apparently Pip can install shit mid-script in all editions of Python. Sweet.
  • Loading branch information
ParzivalWolfram authored Nov 16, 2018
1 parent 9b4fb40 commit e713354
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion imports/terminal_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
try:
import readline
except ImportError:
from imports import winreadline as readline
try:
from imports import winreadline as readline
except ImportError:
print("Required module not installed: readline\nAttempting to install with pip...")
try:
import pip
except ImportError:
sys.exit(1)
if hasattr(pip, 'main'):
pip.main(['install', 'readline'])
else:
pip._internal.main(['install', 'readline'])
import readline

from imports import globals
from imports import manysearches
Expand Down

0 comments on commit e713354

Please sign in to comment.