Skip to content

Commit

Permalink
Fixed #7
Browse files Browse the repository at this point in the history
  • Loading branch information
dhondta committed Sep 8, 2023
1 parent b643181 commit 8eed486
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/codext/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.0
1.15.1
3 changes: 1 addition & 2 deletions src/codext/__common__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,8 +1398,7 @@ def __score(prev_input, input, prev_encoding, encoding, codec, heuristic=False,
except TypeError:
expf = expf(f)
if isinstance(expf, (int, float)):
tmp = expf
expf = (1/f - .1 <= 1/expf <= 1/f + .1)
expf = 1/f - .1 <= 1/expf <= 1/f + .1
elif isinstance(expf, (tuple, list)) and len(expf) == 2:
expf = 1/f - expf[1] <= 1/expf[0] <= 1/f + expf[1]
s += [-1., .1][expf]
Expand Down
2 changes: 1 addition & 1 deletion src/codext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _format_action_invocation(self, action):
else:
print(ensure_str(c or "Could not %scode :-(" % ["en", "de"][args.command == "decode"]), end="")
elif args.command == "guess":
s, lb = args.stop_function, args.lang_backend
s, lb = args.stop_function, getattr(args, "lang_backend", "none")
if re.match(r"lang_[a-z]{2}$", s) and lb != "none" and \
all(re.match(r"lang_[a-z]{2}$", x) is None for x in dir(stopfunc)):
stopfunc._reload_lang(lb)
Expand Down

0 comments on commit 8eed486

Please sign in to comment.