Skip to content

Commit

Permalink
Fix crash without using Module::Runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Nov 22, 2019
1 parent 1e03bf8 commit 75c0b0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ requires 'List::Util::XS', '>= 1.20';
# Note: 1.22 or later is recommended.
requires 'Locale::Messages', '>= 1.20';

# Used to load plugins
requires 'Module::Runtime';

# MHonArc is used to build Sympa web archives
requires 'MHonArc::UTF8';

Expand Down
3 changes: 1 addition & 2 deletions src/lib/Sympa/Message/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package Sympa::Message::Plugin;
use strict;
use warnings;
use English qw(-no_match_vars);
use Module::Runtime qw(use_module);

use Sympa::Log;

Expand Down Expand Up @@ -59,7 +58,7 @@ sub execute {
unless $hook_module =~ /::/;

unless (exists $handlers{$hook_module . '->' . $hook_name}) {
unless (eval { use_module($hook_module); 1; }) {
unless (eval "require $hook_module") {
$log->syslog('err', 'Cannot load hook module %s: %s',
$hook_module, $EVAL_ERROR);
return undef;
Expand Down

0 comments on commit 75c0b0f

Please sign in to comment.