Skip to content

Fix charmap issue #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion deadcode/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import List, Optional
import sys
import io

from deadcode import __version__
from deadcode.actions.find_python_filenames import find_python_filenames
Expand All @@ -10,11 +11,12 @@
get_unused_names_error_message,
)

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')


def main(
command_line_args: Optional[List[str]] = None,
) -> Optional[str]:

if command_line_args and '--version' in command_line_args or '--version' in sys.argv:
return __version__

Expand Down
Loading