mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-18 22:01:42 -04:00
Fixed overly general exception in Python code.
Pylint discovered that I was raising Exception, which was overly general. I didn't mean to do that; it was supposed to be my custom exception type astronomy.Error instead. So I fixed that case. There were also some deprecated settings in the pylint configuration file, so I fixed those too.
This commit is contained in:
@@ -6955,7 +6955,7 @@ def SphereFromVector(vector):
|
||||
dist = math.sqrt(xyproj + vector.z*vector.z)
|
||||
if xyproj == 0.0:
|
||||
if vector.z == 0.0:
|
||||
raise Exception('Zero-length vector not allowed.')
|
||||
raise Error('Zero-length vector not allowed.')
|
||||
lon = 0.0
|
||||
if vector.z < 0.0:
|
||||
lat = -90.0
|
||||
|
||||
@@ -103,9 +103,7 @@ disable=invalid-name,
|
||||
chained-comparison,
|
||||
consider-using-in,
|
||||
too-many-nested-blocks,
|
||||
too-many-instance-attributes,
|
||||
bad-whitespace,
|
||||
bad-continuation
|
||||
too-many-instance-attributes
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
@@ -576,5 +574,4 @@ preferred-modules=
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "BaseException, Exception".
|
||||
overgeneral-exceptions=BaseException,
|
||||
Exception
|
||||
overgeneral-exceptions=builtins.BaseException, builtins.Exception
|
||||
|
||||
@@ -5449,7 +5449,7 @@ def SphereFromVector(vector):
|
||||
dist = math.sqrt(xyproj + vector.z*vector.z)
|
||||
if xyproj == 0.0:
|
||||
if vector.z == 0.0:
|
||||
raise Exception('Zero-length vector not allowed.')
|
||||
raise Error('Zero-length vector not allowed.')
|
||||
lon = 0.0
|
||||
if vector.z < 0.0:
|
||||
lat = -90.0
|
||||
|
||||
@@ -6955,7 +6955,7 @@ def SphereFromVector(vector):
|
||||
dist = math.sqrt(xyproj + vector.z*vector.z)
|
||||
if xyproj == 0.0:
|
||||
if vector.z == 0.0:
|
||||
raise Exception('Zero-length vector not allowed.')
|
||||
raise Error('Zero-length vector not allowed.')
|
||||
lon = 0.0
|
||||
if vector.z < 0.0:
|
||||
lat = -90.0
|
||||
|
||||
Reference in New Issue
Block a user