[libdatetime-timezone-perl] 04/07: Really eliminate all uses of "local $SIG{__DIE__} = undef"

gregor herrmann gregoa at debian.org
Wed Apr 15 19:03:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to annotated tag v1.78
in repository libdatetime-timezone-perl.

commit 21af430aa10ab6c88ccf39c098d5d117b19c4925
Author: Dave Rolsky <autarch at urth.org>
Date:   Wed Nov 5 09:15:26 2014 -0600

    Really eliminate all uses of "local $SIG{__DIE__} = undef"
---
 Changes                                |  4 ++++
 lib/DateTime/TimeZone/Local.pm         |  4 ++--
 lib/DateTime/TimeZone/Local/Android.pm |  4 ++--
 lib/DateTime/TimeZone/Local/Unix.pm    | 12 ++++++------
 lib/DateTime/TimeZone/Local/Win32.pm   |  2 +-
 5 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/Changes b/Changes
index c4e8d49..6d84be1 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 {{$NEXT}}
 
+- Fix warnings from Perl 5.8.8 and before. Apparently it doesn't like when
+  $SIG{__DIE__} is set to undef. Patch by Peter Rabbitson. GitHub PR #88.
+
+
 1.77    2014-11-04
 
 - Updated the mapping of Windows -> IANA time zones. Patch by David
diff --git a/lib/DateTime/TimeZone/Local.pm b/lib/DateTime/TimeZone/Local.pm
index 62e8b87..d051f5d 100644
--- a/lib/DateTime/TimeZone/Local.pm
+++ b/lib/DateTime/TimeZone/Local.pm
@@ -48,7 +48,7 @@ sub TimeZone {
         return $subclass if $subclass->can('Methods');
 
         return $subclass if try {
-            local $SIG{__DIE__} = undef;
+            local $SIG{__DIE__};
             require_module($subclass);
         };
 
@@ -66,7 +66,7 @@ sub FromEnv {
     foreach my $var ( $class->EnvVars() ) {
         if ( $class->_IsValidName( $ENV{$var} ) ) {
             my $tz = try {
-                local $SIG{__DIE__} = undef;
+                local $SIG{__DIE__};
                 DateTime::TimeZone->new( name => $ENV{$var} );
             };
 
diff --git a/lib/DateTime/TimeZone/Local/Android.pm b/lib/DateTime/TimeZone/Local/Android.pm
index 5e6bd0b..83f1046 100644
--- a/lib/DateTime/TimeZone/Local/Android.pm
+++ b/lib/DateTime/TimeZone/Local/Android.pm
@@ -22,7 +22,7 @@ sub FromGetProp {
     my $name = `getprop persist.sys.timezone`;
     chomp $name;
     my $tz = try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         DateTime::TimeZone->new( name => $name );
     };
 
@@ -32,7 +32,7 @@ sub FromGetProp {
 # See the link above. Android always defaults to UTC
 sub FromDefault {
     my $tz = try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         $tz = DateTime::TimeZone->new( name => 'UTC' );
     }
 
diff --git a/lib/DateTime/TimeZone/Local/Unix.pm b/lib/DateTime/TimeZone/Local/Unix.pm
index e86a016..71da1bd 100644
--- a/lib/DateTime/TimeZone/Local/Unix.pm
+++ b/lib/DateTime/TimeZone/Local/Unix.pm
@@ -57,7 +57,7 @@ sub FromEtcLocaltime {
             );
 
             my $tz = try {
-                local $SIG{__DIE__} = undef;
+                local $SIG{__DIE__};
                 DateTime::TimeZone->new( name => $name );
             };
 
@@ -90,7 +90,7 @@ sub _FindMatchingZoneinfoFile {
 
     my $real_name;
     try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         local $_;
 
         File::Find::find(
@@ -143,7 +143,7 @@ sub FromEtcTimezone {
     return unless $class->_IsValidName($name);
 
     return try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         DateTime::TimeZone->new( name => $name );
     };
 }
@@ -170,7 +170,7 @@ sub FromEtcTIMEZONE {
     return unless $class->_IsValidName($name);
 
     return try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         DateTime::TimeZone->new( name => $name );
     };
 }
@@ -187,7 +187,7 @@ sub FromEtcSysconfigClock {
     return unless $class->_IsValidName($name);
 
     return try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         DateTime::TimeZone->new( name => $name );
     };
 }
@@ -217,7 +217,7 @@ sub FromEtcDefaultInit {
     return unless $class->_IsValidName($name);
 
     return try {
-        local $SIG{__DIE__} = undef;
+        local $SIG{__DIE__};
         DateTime::TimeZone->new( name => $name );
     };
 }
diff --git a/lib/DateTime/TimeZone/Local/Win32.pm b/lib/DateTime/TimeZone/Local/Win32.pm
index 10cba35..744bfdf 100644
--- a/lib/DateTime/TimeZone/Local/Win32.pm
+++ b/lib/DateTime/TimeZone/Local/Win32.pm
@@ -221,7 +221,7 @@ sub EnvVars { return 'TZ' }
         return unless $class->_IsValidName($olson);
 
         return try {
-            local $SIG{__DIE__} = undef;
+            local $SIG{__DIE__};
             DateTime::TimeZone->new( name => $olson );
         };
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdatetime-timezone-perl.git



More information about the Pkg-perl-cvs-commits mailing list