Skip to content

Commit 3127a09

Browse files
refactor: fix black and mypy warnings
1 parent 1f15e76 commit 3127a09

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

deepl/translator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,7 @@ def join_tags(tag_argument: Union[str, Iterable[str]]) -> List[str]:
461461
if translation
462462
else ""
463463
)
464-
billed_characters = util.get_int_safe(
465-
translation, "billed_characters"
466-
)
464+
billed_characters = int(translation.get("billed_characters"))
467465
output.append(
468466
TextResult(text, detected_source_language, billed_characters)
469467
)

tests/test_general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def test_example_translation(lang, translator):
3232

3333
input_text = example_text[lang]
3434
source_lang = deepl.Language.remove_regional_variant(lang)
35-
result = (translator.translate_text(
35+
result = translator.translate_text(
3636
input_text, source_lang=source_lang, target_lang="EN-US"
37-
))
37+
)
3838
assert "proton" in result.text.lower()
3939
assert result.billed_characters == len(input_text)
4040

0 commit comments

Comments
 (0)