diff --git a/pylintrc b/pylintrc index 0801c2a..2e6b1c7 100644 --- a/pylintrc +++ b/pylintrc @@ -307,8 +307,8 @@ min-public-methods=2 [EXCEPTIONS] # Exceptions that will emit a warning when caught. -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtins.BaseException, + builtins.Exception [FORMAT] diff --git a/src/edge_tts/communicate.py b/src/edge_tts/communicate.py index d482b84..06cc145 100644 --- a/src/edge_tts/communicate.py +++ b/src/edge_tts/communicate.py @@ -2,7 +2,6 @@ Communicate package. """ - import json import re import ssl @@ -152,7 +151,9 @@ def split_text_by_byte_length( yield new_text -def mkssml(text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str) -> str: +def mkssml( + text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str +) -> str: """ Creates a SSML string from the given parameters. diff --git a/src/edge_tts/util.py b/src/edge_tts/util.py index 0fde83e..f1c25b4 100644 --- a/src/edge_tts/util.py +++ b/src/edge_tts/util.py @@ -2,7 +2,6 @@ Main package. """ - import argparse import asyncio import sys @@ -60,9 +59,9 @@ async def _run_tts(args: Any) -> None: pitch=args.pitch, ) subs: SubMaker = SubMaker() - with open( - args.write_media, "wb" - ) if args.write_media else sys.stdout.buffer as audio_file: + with ( + open(args.write_media, "wb") if args.write_media else sys.stdout.buffer + ) as audio_file: async for chunk in tts.stream(): if chunk["type"] == "audio": audio_file.write(chunk["data"])