Print a helpful message when bot.py or bot4.py isn't found.
This commit is contained in:
parent
5345e8f4fc
commit
dd38e0c8da
1 changed files with 9 additions and 2 deletions
|
@ -19,8 +19,15 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
bot = None
|
bot = None
|
||||||
if bot is None or bot.praw != praw:
|
if bot is None or bot.praw != praw:
|
||||||
|
try:
|
||||||
import bot4
|
import bot4
|
||||||
bot = bot4
|
bot = bot4
|
||||||
|
except ImportError:
|
||||||
|
message = '\n'.join([
|
||||||
|
'Could not find your PRAW4 bot file as either `bot.py` or `bot4.py`.',
|
||||||
|
'Please see the README.md file for instructions on how to prepare it.'
|
||||||
|
])
|
||||||
|
raise ImportError(message)
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
|
|
Loading…
Reference in a new issue