summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-07-01 15:09:20 -0300
committerJesusaves <cpntb1@ymail.com>2023-07-01 15:09:20 -0300
commitd44c7cb22ae3672eea83f17056253367bee5ffb2 (patch)
treeddf94c0632b199e2a21335bc6748f6d08b553c9a
parent3487d46fa34008a1273fd364a353dafbaa18087a (diff)
downloadrenpy-d44c7cb22ae3672eea83f17056253367bee5ffb2.tar.gz
renpy-d44c7cb22ae3672eea83f17056253367bee5ffb2.tar.bz2
renpy-d44c7cb22ae3672eea83f17056253367bee5ffb2.tar.xz
renpy-d44c7cb22ae3672eea83f17056253367bee5ffb2.zip
Fix bugs reported by Hocus
-rw-r--r--game/core.rpy7
1 files changed, 5 insertions, 2 deletions
diff --git a/game/core.rpy b/game/core.rpy
index efc24bb..c3fa6e5 100644
--- a/game/core.rpy
+++ b/game/core.rpy
@@ -29,7 +29,10 @@ init -3 python:
# This is Python 3.x
execute=subprocess.run
LEGACY = False
- import mwclient
+ if config.developer:
+ import mwclient
+ else:
+ mwclient = None
print("Python 3.x detected! Version is %d." % PYTHON_VERSION)
else:
# This is Python 2.7
@@ -140,7 +143,7 @@ init -3 python:
# Calculates a 2FA Token
def calcOTP(key):
- if not LEGACY:
+ if not LEGACY and not isinstance(key, bytes):
key = bytes(key, 'ascii')
msg = struct.pack(">Q", int(time.time()/30))
h = hmac.new(key, msg, hashlib.sha1).digest()