Expand ASSERT_NO_SPURIOUS_EXCEPTION_ACTION to set a rogue $SIG{__DIE__}
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / _Util.pm
index 846920d..8c62054 100644 (file)
@@ -23,12 +23,6 @@ BEGIN {
 
     UNSTABLE_DOLLARAT => ( "$]" < 5.013002 ) ? 1 : 0,
 
-    DBICTEST => $INC{"DBICTest/Util.pm"} ? 1 : 0,
-
-    # During 5.13 dev cycle HELEMs started to leak on copy
-    # add an escape for these perls ON SMOKERS - a user will still get death
-    PEEPEENESS => ( eval { DBICTest::RunMode->is_smoker } && ( "$]" >= 5.013005 and "$]" <= 5.013006) ),
-
     ( map
       #
       # the "DBIC_" prefix below is crucial - this is what makes CI pick up
@@ -82,7 +76,7 @@ our @EXPORT_OK = qw(
   scope_guard detected_reinvoked_destructor
   is_exception dbic_internal_try
   quote_sub qsub perlstring serialize deep_clone
-  parent_dir
+  parent_dir mkdir_p
   UNRESOLVABLE_CONDITION
 );
 
@@ -167,6 +161,7 @@ sub is_exception ($) {
 
   my ($not_blank, $suberror);
   {
+    local $SIG{__DIE__} if $SIG{__DIE__};
     local $@;
     eval {
       # The ne() here is deliberate - a plain length($e), or worse "$e" ne
@@ -276,9 +271,7 @@ sub is_exception ($) {
         unless $callstack_state->{in_internal_try};
 
       # always unset - someone may have snuck it in
-      local $SIG{__DIE__}
-        if $SIG{__DIE__};
-
+      local $SIG{__DIE__} if $SIG{__DIE__};
 
       if( $wantarray ) {
         @ret = $try_cref->();
@@ -389,8 +382,8 @@ sub modver_gt_or_eq ($$) {
     local $SIG{__WARN__} = sigwarn_silencer( qr/\Qisn't numeric in subroutine entry/ )
       if SPURIOUS_VERSION_CHECK_WARNINGS;
 
+    local $SIG{__DIE__} if $SIG{__DIE__};
     local $@;
-    local $SIG{__DIE__};
     eval { $mod->VERSION($ver) } ? 1 : 0;
   };
 
@@ -451,6 +444,12 @@ sub parent_dir ($) {
   ;
 }
 
+sub mkdir_p ($) {
+  require File::Path;
+  # do not ask for a recent version, use 1.x API calls
+  File::Path::mkpath([ "$_[0]" ]);  # File::Path does not like objects
+}
+
 
 {
   my $list_ctx_ok_stack_marker;