[libtry-tiny-perl] 01/03: Imported Upstream version 0.17
Salvatore Bonaccorso
carnil at debian.org
Sat Aug 17 10:03:45 UTC 2013
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to annotated tag debian/0.17-1
in repository libtry-tiny-perl.
commit e5b233143d2f46ab245a451b4e61f4c515f974d1
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Sat Aug 17 11:53:29 2013 +0200
Imported Upstream version 0.17
---
Changes | 4 +++
MANIFEST | 1 +
META.json | 5 ++--
META.yml | 5 ++--
Makefile.PL | 2 +-
README | 2 +-
lib/Try/Tiny.pm | 8 +++---
t/global_destruction_forked.t | 57 +++++++++++++++++++++++++++++++++++++++++
8 files changed, 75 insertions(+), 9 deletions(-)
diff --git a/Changes b/Changes
index 2229904..a57cbb7 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
Revision history for Try-Tiny
+0.17 2013-08-16
+ - work around [rt.perl #119311] which was causing incorrect error messages in
+ some cases during global destruction (Graham Knop, #9)
+
0.16 2013-07-10
- remove accidental Sub::Name test dep
diff --git a/MANIFEST b/MANIFEST
index 9ad0f0c..81af55a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -14,6 +14,7 @@ t/context.t
t/erroneous_usage.t
t/finally.t
t/given_when.t
+t/global_destruction_forked.t
t/named.t
t/when.t
xt/release/eol.t
diff --git a/META.json b/META.json
index acbc8c9..512d49d 100644
--- a/META.json
+++ b/META.json
@@ -59,10 +59,10 @@
"web" : "https://github.com/doy/try-tiny"
}
},
- "version" : "0.16",
+ "version" : "0.17",
"x_Dist_Zilla" : {
"perl" : {
- "version" : "5.018000"
+ "version" : "5.018001"
},
"plugins" : [
{
@@ -290,6 +290,7 @@
"Alex <alex at koban.(none)>",
"Andrew Yates <ayates at haddock.local>",
"Glenn Fowler <cebjyre at cpan.org>",
+ "Graham Knop <haarg at haarg.org>",
"Hans Dieter Pearcey <hdp at weftsoar.net>",
"Jonathan Yu <JAWNSY at cpan.org>",
"Karen Etheridge <ether at cpan.org>",
diff --git a/META.yml b/META.yml
index 46a577d..262d1c1 100644
--- a/META.yml
+++ b/META.yml
@@ -29,10 +29,10 @@ resources:
bugtracker: https://github.com/doy/try-tiny/issues
homepage: http://metacpan.org/release/Try-Tiny
repository: git://github.com/doy/try-tiny.git
-version: 0.16
+version: 0.17
x_Dist_Zilla:
perl:
- version: 5.018000
+ version: 5.018001
plugins:
-
class: Dist::Zilla::Plugin::GatherDir
@@ -212,6 +212,7 @@ x_contributors:
- 'Alex <alex at koban.(none)>'
- 'Andrew Yates <ayates at haddock.local>'
- 'Glenn Fowler <cebjyre at cpan.org>'
+ - 'Graham Knop <haarg at haarg.org>'
- 'Hans Dieter Pearcey <hdp at weftsoar.net>'
- 'Jonathan Yu <JAWNSY at cpan.org>'
- 'Karen Etheridge <ether at cpan.org>'
diff --git a/Makefile.PL b/Makefile.PL
index 342e636..c72e25a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -33,7 +33,7 @@ my %WriteMakefileArgs = (
"Test::More" => 0,
"if" => 0
},
- "VERSION" => "0.16",
+ "VERSION" => "0.17",
"test" => {
"TESTS" => "t/*.t"
}
diff --git a/README b/README
index 64e4c46..9ee1122 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
This archive contains the distribution Try-Tiny,
-version 0.16:
+version 0.17:
minimal try/catch with proper preservation of $@
diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm
index cf0a016..50045a7 100644
--- a/lib/Try/Tiny.pm
+++ b/lib/Try/Tiny.pm
@@ -3,7 +3,7 @@ BEGIN {
$Try::Tiny::AUTHORITY = 'cpan:NUFFIN';
}
{
- $Try::Tiny::VERSION = '0.16';
+ $Try::Tiny::VERSION = '0.17';
}
use 5.006;
# ABSTRACT: minimal try/catch with proper preservation of $@
@@ -30,7 +30,9 @@ sub try (&;@) {
# to $failed
my $wantarray = wantarray;
- my ( $catch, @finally );
+ # work around perl bug by explicitly initializing these, due to the likelyhood
+ # this will be used in global destruction (perl rt#119311)
+ my ( $catch, @finally ) = ();
# find labeled blocks in the argument list.
# catch and finally tag the blocks by blessing a scalar reference to them.
@@ -180,7 +182,7 @@ Try::Tiny - minimal try/catch with proper preservation of $@
=head1 VERSION
-version 0.16
+version 0.17
=head1 SYNOPSIS
diff --git a/t/global_destruction_forked.t b/t/global_destruction_forked.t
new file mode 100644
index 0000000..a9c306f
--- /dev/null
+++ b/t/global_destruction_forked.t
@@ -0,0 +1,57 @@
+use strict;
+use warnings;
+use Test::More;
+use Try::Tiny;
+
+{
+ package WithCatch;
+ use Try::Tiny;
+
+ sub DESTROY {
+ try {}
+ catch {};
+ return;
+ }
+}
+
+{
+ package WithFinally;
+ use Try::Tiny;
+
+ sub DESTROY {
+ try {}
+ finally {};
+ return;
+ }
+}
+
+my $parent = $$;
+
+try {
+ my $pid = fork;
+ unless ($pid) {
+ my $o = bless {}, 'WithCatch';
+ $SIG{__DIE__} = sub {
+ exit 1
+ if $_[0] =~ /A try\(\) may not be followed by multiple catch\(\) blocks/;
+ exit 2;
+ };
+ exit 0;
+ }
+ waitpid $pid, 0;
+ is $?, 0, 'nested try in cleanup after fork does not maintain outer catch block';
+}
+catch {};
+
+try {
+ my $pid = fork;
+ unless ($pid) {
+ my $o = bless {}, 'WithFinally';
+ exit 0;
+ }
+ waitpid $pid, 0;
+ is $?, 0, 'nested try in cleanup after fork does not maintain outer finally block';
+}
+finally { exit 1 if $parent != $$ };
+
+done_testing;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtry-tiny-perl.git
More information about the Pkg-perl-cvs-commits
mailing list