diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-09-03 11:02:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-03 11:02:06 -0600 |
commit | 11420ae27f36bf8a49b7661be44dad94f39a79b0 (patch) | |
tree | e2ebcbfb93ef3503fd5d42b93d2c7e720343e3bb | |
parent | 516355fc0cd4f507075abb9df5442ce8a58e6ab3 (diff) | |
parent | e4c589054b342dc750cdd09686c0c01ab762679c (diff) | |
download | numpy-11420ae27f36bf8a49b7661be44dad94f39a79b0.tar.gz |
Merge pull request #19818 from sistaseetaram/related-to-#19077
MAINT: fix unhashable instance and potential exception identified by LGTM.
-rw-r--r-- | numpy/array_api/_typing.py | 2 | ||||
-rw-r--r-- | numpy/linalg/lapack_lite/clapack_scrub.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/numpy/array_api/_typing.py b/numpy/array_api/_typing.py index d530a91ae..831a108bc 100644 --- a/numpy/array_api/_typing.py +++ b/numpy/array_api/_typing.py @@ -37,7 +37,7 @@ NestedSequence = Sequence[Sequence[Any]] Device = Any Dtype = Type[ - Union[[int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64]] + Union[int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64] ] SupportsDLPack = Any SupportsBufferProtocol = Any diff --git a/numpy/linalg/lapack_lite/clapack_scrub.py b/numpy/linalg/lapack_lite/clapack_scrub.py index 738fad7fe..44c0d92d9 100644 --- a/numpy/linalg/lapack_lite/clapack_scrub.py +++ b/numpy/linalg/lapack_lite/clapack_scrub.py @@ -299,6 +299,5 @@ if __name__ == '__main__': source = scrub_source(source, nsteps, verbose=True) - writefo = open(outfilename, 'w') - writefo.write(source) - writefo.close() + with open(outfilename, 'w') as writefo: + writefo.write(source) |