Skip to content

Commit 8f64ce9

Browse files
committed
changed ImportError to ModuleNotFoundError for spa_calc
1 parent 75c114a commit 8f64ce9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pvlib/solarposition.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ def spa_c(time, latitude, longitude, pressure=101325., altitude=0.,
190190

191191
try:
192192
from pvlib.spa_c_files.spa_py import spa_calc
193-
except ImportError:
194-
raise ImportError('Could not import built-in SPA calculator. ' +
195-
'You may need to recompile the SPA code.')
193+
except ModuleNotFoundError as e:
194+
raise ModuleNotFoundError(
195+
"Could not import built-in SPA calculator. "
196+
"You may need to recompile the SPA code."
197+
) from e
196198

197199
time_utc = tools._pandas_to_utc(time)
198200

0 commit comments

Comments
 (0)