Skip to content

Commit db79bf9

Browse files
committed
perl5db.pl: ensure PadWalker is loaded from standard paths
1 parent d8f1b4d commit db79bf9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/perl5db.pl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,10 @@ sub _DB__handle_y_command {
19511951
= $obj->cmd_args =~ /\A(?:(\d*)\s*(.*))?\z/) {
19521952

19531953
# See if we've got the necessary support.
1954-
if (!eval { require PadWalker; PadWalker->VERSION(0.08) }) {
1954+
if (!eval {
1955+
local @INC = @INC;
1956+
pop @INC if $INC[-1] eq '.';
1957+
require PadWalker; PadWalker->VERSION(0.08) }) {
19551958
my $Err = $@;
19561959
_db_warn(
19571960
$Err =~ /locate/
@@ -9441,7 +9444,10 @@ =head3 Symbol completion: current package or package C<main>.
94419444
94429445
=cut
94439446

9444-
if (not $text =~ /::/ and eval { require PadWalker } ) {
9447+
if (not $text =~ /::/ and eval {
9448+
local @INC = @INC;
9449+
pop @INC if $INC[-1] eq '.';
9450+
require PadWalker } ) {
94459451
my $level = 1;
94469452
while (1) {
94479453
my @info = caller($level);

0 commit comments

Comments
 (0)