aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcwrapper/mod.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mcwrapper/mod.py b/mcwrapper/mod.py
index 78ffb8e..3d3967c 100644
--- a/mcwrapper/mod.py
+++ b/mcwrapper/mod.py
@@ -2,6 +2,7 @@
import random
from . import alarm
+from . import prints
class MoD:
@@ -14,8 +15,12 @@ class MoD:
def load_mods(self):
"Loads messages from self.file"
- with open(self.file, "r") as f:
- self.lines = f.readlines()
+ try:
+ with open(self.file, "r") as f:
+ self.lines = f.readlines()
+ except OSError as e:
+ prints.warning("Loading of MoD file failed: " + str(e))
+ self.lines = []
def __handler__(self):
if len(self.lines) > 0: