Skip to content

Commit 8eed486

Browse files
committed
Fixed #7
1 parent b643181 commit 8eed486

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/codext/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.15.0
1+
1.15.1

src/codext/__common__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,7 @@ def __score(prev_input, input, prev_encoding, encoding, codec, heuristic=False,
13981398
except TypeError:
13991399
expf = expf(f)
14001400
if isinstance(expf, (int, float)):
1401-
tmp = expf
1402-
expf = (1/f - .1 <= 1/expf <= 1/f + .1)
1401+
expf = 1/f - .1 <= 1/expf <= 1/f + .1
14031402
elif isinstance(expf, (tuple, list)) and len(expf) == 2:
14041403
expf = 1/f - expf[1] <= 1/expf[0] <= 1/f + expf[1]
14051404
s += [-1., .1][expf]

src/codext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def _format_action_invocation(self, action):
227227
else:
228228
print(ensure_str(c or "Could not %scode :-(" % ["en", "de"][args.command == "decode"]), end="")
229229
elif args.command == "guess":
230-
s, lb = args.stop_function, args.lang_backend
230+
s, lb = args.stop_function, getattr(args, "lang_backend", "none")
231231
if re.match(r"lang_[a-z]{2}$", s) and lb != "none" and \
232232
all(re.match(r"lang_[a-z]{2}$", x) is None for x in dir(stopfunc)):
233233
stopfunc._reload_lang(lb)

0 commit comments

Comments
 (0)