summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm18
1 files changed, 12 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm b/Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm
index 89e22b57207..b0685d2ec12 100644
--- a/Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm
+++ b/Master/tlpkg/tlperl/lib/Module/Load/Conditional.pm
@@ -22,7 +22,7 @@ BEGIN {
$FIND_VERSION $ERROR $CHECK_INC_HASH $FORCE_SAFE_INC ];
use Exporter;
@ISA = qw[Exporter];
- $VERSION = '0.68';
+ $VERSION = '0.70';
$VERBOSE = 0;
$DEPRECATED = 0;
$FIND_VERSION = 1;
@@ -259,13 +259,19 @@ sub check_install {
last DIR unless $FIND_VERSION;
### otherwise, the user wants us to find the version from files
- my $mod_info = Module::Metadata->new_from_handle( $fh, $filename );
- my $ver = $mod_info->version( $args->{module} );
- if( defined $ver ) {
- $href->{version} = $ver;
+ {
+ local $SIG{__WARN__} = sub {};
+ my $ver = eval {
+ my $mod_info = Module::Metadata->new_from_handle( $fh, $filename );
+ $mod_info->version( $args->{module} );
+ };
- last DIR;
+ if( defined $ver ) {
+ $href->{version} = $ver;
+
+ last DIR;
+ }
}
}
}