Skip to content

Commit 33f7ce3

Browse files
committed
0.10.6: wrap pwd() in try-catch block
1 parent 1c03d17 commit 33f7ce3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Pipelines"
22
uuid = "ef544631-5c6f-4e9b-994c-12e7a4cd724c"
33
authors = ["Jiacheng Chuan <[email protected]>"]
4-
version = "0.10.5"
4+
version = "0.10.6"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

docs/src/changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## v0.10.6
4+
5+
- Fix: `run(::Program)`: wrap `pwd()` in try-catch block in case the dir no longer exists. It happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.
6+
37
## v0.10.5
48

59
- Compat: Julia v1.10: `hasmethod(f, t)` in Julia v1.10 changed its behavior. It affects Program function check. Use `length(methods(f, t))` instead.

src/Program.jl

+6-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,12 @@ function Base.run(p::Program;
257257
stdout = nothing, stderr = nothing, stdlog = stderr, append::Bool = false, _do_parse_program_args::Bool = true, kwarg...
258258
)
259259
if dir != ""
260-
dir_backup = pwd()
260+
dir_backup = try
261+
# in case the dir no longer exists. happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.
262+
pwd()
263+
catch
264+
""
265+
end
261266
dir = abspath(dir)
262267
cd(dir) # go to working directory
263268
end

0 commit comments

Comments
 (0)