Skip to content

Commit 7f87d5e

Browse files
committed
Replace random .pick with File::Temp usage.
Fix for #1062
1 parent 0ffb783 commit 7f87d5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

htmlify.p6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use Perl6::Documentable::Registry;
2929
use Pod::Convenience;
3030
use Pod::Htmlify;
3131
use JSON::Fast;
32+
use File::Temp;
3233

3334
&spurt.wrap(sub (|c){
3435
state %seen-paths;
@@ -1016,8 +1017,7 @@ sub highlight-code-blocks(:$use-inline-python = True, :$use-highlights = False)
10161017
return $py.call('__main__', 'p6format', $node.contents.join);
10171018
}
10181019
else {
1019-
my $basename = join '-', %*ENV<USER> // 'u', (^100_000).pick, 'pod_to_pyg.pod';
1020-
my $tmp_fname = "$*TMPDIR/$basename";
1020+
my $tmp_fname = tempfile(:prefix(%*ENV<USER> ~ '-' // 'u-'), :suffix('-pod_to_pyg.pod'));
10211021
spurt $tmp_fname, $node.contents.join;
10221022
LEAVE try unlink $tmp_fname;
10231023
my $command;

0 commit comments

Comments
 (0)