mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-12 09:36:35 +01:00
avoid AttributeError in tests
StringIO in tests do not have all attributes, ignore it
This commit is contained in:
parent
6406fcaef7
commit
496564a605
1 changed files with 5 additions and 1 deletions
|
|
@ -133,7 +133,11 @@ def main(sys_args: list[str]) -> None:
|
||||||
# allow to use sys.stdout with with (avoid closing)
|
# allow to use sys.stdout with with (avoid closing)
|
||||||
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
|
||||||
sys.stdout.reconfigure(encoding='utf-8') # type: ignore
|
try:
|
||||||
|
sys.stdout.reconfigure(encoding='utf-8') # type: ignore
|
||||||
|
except AttributeError: # '_io.StringIO' object has no attribute 'reconfigure'
|
||||||
|
# StringIO in tests do not have all attributes, ignore it
|
||||||
|
pass
|
||||||
|
|
||||||
args = parse_args(sys_args)
|
args = parse_args(sys_args)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue