Skip to content

Commit c411ea0

Browse files
authored
Emit more accurate error message (#760)
* Emit more accurate error message Until issue #645 is resolved, this is a measure to not mislead the user. * Fix test
1 parent 064cf66 commit c411ea0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PyCall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function pyimport(name::AbstractString)
495495
if pyisinstance(e.val, @pyglobalobjptr(:PyExc_ImportError))
496496
# Expand message to help with common user confusions.
497497
msg = """
498-
The Python package $name could not be found by pyimport. Usually this means
498+
The Python package $name could not be imported by pyimport. Usually this means
499499
that you did not install $name in the Python version being used by PyCall.
500500
501501
"""

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
353353
ex
354354
end
355355
@test ex isa PyCall.PyError
356-
@test occursin("could not be found by pyimport", ex.msg)
356+
@test occursin("could not be imported by pyimport", ex.msg)
357357
# Make sure we are testing ModuleNotFoundError here:
358358
if PyCall.pyversion >= v"3.6"
359359
@test pyisinstance(ex.val, pybuiltin("ModuleNotFoundError"))

0 commit comments

Comments
 (0)