diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2016-07-22 11:12:54 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2016-12-15 14:46:06 +0100 |
commit | 9a95fb682c3f4236a9df9b41f301d2c85ac134d4 (patch) | |
tree | ed28c801a6701ae3cd860f487ad168d325c41fc5 /tests/fips.py | |
parent | c295b5bc8aa9137938bfbe841b544a2a5c192ac1 (diff) | |
download | m2crypto-9a95fb682c3f4236a9df9b41f301d2c85ac134d4.tar.gz |
Elimination of all open() statements w/o context managers.
Diffstat (limited to 'tests/fips.py')
-rw-r--r-- | tests/fips.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/fips.py b/tests/fips.py index 9cc50c5..6b2ba3e 100644 --- a/tests/fips.py +++ b/tests/fips.py @@ -1,8 +1,5 @@ try: - f = open('/proc/sys/crypto/fips_enabled') - try: + with open('/proc/sys/crypto/fips_enabled') as f: fips_mode = int(f.read()) - finally: - f.close() -except Exception as e: +except (IOError, OSError): fips_mode = 0 |