mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
Handle missing ModuleNotFoundError in py3.5
This commit is contained in:
parent
8d18cce3b0
commit
c68d690f7e
2 changed files with 7 additions and 1 deletions
|
|
@ -333,7 +333,7 @@ class LanguageHandler(DefaultScript):
|
|||
new_word = ''
|
||||
else:
|
||||
# use random word length
|
||||
wlen = choice(grammar.keys())
|
||||
wlen = choice(list(grammar.keys()))
|
||||
|
||||
if wlen:
|
||||
structure = choice(grammar[wlen])
|
||||
|
|
|
|||
|
|
@ -34,6 +34,12 @@ _EVENNIA_DIR = settings.EVENNIA_DIR
|
|||
_GAME_DIR = settings.GAME_DIR
|
||||
|
||||
|
||||
# ModuleNotFoundError only in py3.6, handle both
|
||||
try:
|
||||
from builtins import ModuleNotFoundError
|
||||
except ImportError:
|
||||
ModuleNotFoundError = ImportError
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue