- if (($INC{'Test/More.pm'} || $INC{'Test/Leaner.pm'}) && !$INC{'threads.pm'}) {
- die 'Test::More/Test::Leaner was loaded too soon';
+ unless ($INC{'threads.pm'}) {
+ my $test_module;
+ if ($INC{'Test/Leaner.pm'}) {
+ $test_module = 'Test::Leaner';
+ } elsif ($INC{'Test/More.pm'}) {
+ $test_module = 'Test::More';
+ }
+ die "$test_module was loaded too soon" if defined $test_module;