mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-18 12:26:29 +01:00
ignore types for stdout.reconfigure
This commit is contained in:
parent
b3fc854078
commit
003e122808
3 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ ARG RUN_TESTS=true
|
||||||
RUN apk add --no-cache zlib jpeg \
|
RUN apk add --no-cache zlib jpeg \
|
||||||
&& echo "Arch: $(apk --print-arch)" \
|
&& echo "Arch: $(apk --print-arch)" \
|
||||||
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk add --no-cache --virtual .build-deps gcc libc-dev python3-dev py3-setuptools zlib-dev jpeg-dev; fi \
|
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk add --no-cache --virtual .build-deps gcc libc-dev python3-dev py3-setuptools zlib-dev jpeg-dev; fi \
|
||||||
&& pip install --no-cache-dir protobuf qrcode Pillow \
|
&& pip install --no-cache-dir protobuf qrcode Pillow colorama \
|
||||||
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk del .build-deps; fi \
|
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk del .build-deps; fi \
|
||||||
&& if [[ "$RUN_TESTS" == "true" ]]; then /extract/run_pytest.sh tests/extract_otp_secrets_test.py -k "not qreader" --relaxed; else echo "Not running tests..."; fi
|
&& if [[ "$RUN_TESTS" == "true" ]]; then /extract/run_pytest.sh tests/extract_otp_secrets_test.py -k "not qreader" --relaxed; else echo "Not running tests..."; fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ def main(sys_args: list[str]) -> None:
|
||||||
sys.stdout.close = lambda: None # type: ignore
|
sys.stdout.close = lambda: None # type: ignore
|
||||||
# set encoding to utf-8, needed for Windows
|
# set encoding to utf-8, needed for Windows
|
||||||
try:
|
try:
|
||||||
sys.stdout.reconfigure(encoding='utf-8')
|
sys.stdout.reconfigure(encoding='utf-8') # type: ignore
|
||||||
sys.stderr.reconfigure(encoding='utf-8')
|
sys.stderr.reconfigure(encoding='utf-8') # type: ignore
|
||||||
except AttributeError: # '_io.StringIO' object has no attribute 'reconfigure'
|
except AttributeError: # '_io.StringIO' object has no attribute 'reconfigure'
|
||||||
# StringIO in tests do not have all attributes, ignore it
|
# StringIO in tests do not have all attributes, ignore it
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue