@@ -2925,21 +2925,21 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
2925
2925
end
2926
2926
end
2927
2927
2928
- function rename_unique_ocachefile (tmppath_so, ocachefile_orig, ocachefile = ocachefile_orig, num = 1 )
2928
+ function rename_unique_ocachefile (tmppath_so:: String , ocachefile_orig:: String , ocachefile:: String = ocachefile_orig, num = 1 )
2929
2929
try
2930
- rename (tmppath_so, ocachefile:: String ; force= true )
2930
+ rename (tmppath_so, ocachefile; force= true )
2931
2931
catch e
2932
2932
e isa IOError || rethrow ()
2933
2933
# If `rm` was called on a dir containing a loaded DLL, we moved it to temp for cleanup
2934
2934
# on restart. However the old path cannot be used (UV_EACCES) while the DLL is loaded
2935
- if ! isfile (ocachefile:: String ) || ! ( err. code == Base. UV_EACCES)
2935
+ if ! isfile (ocachefile) && err. code != Base. UV_EACCES
2936
2936
rethrow ()
2937
2937
end
2938
2938
# Windows prevents renaming a file that is in use so if there is a Julia session started
2939
2939
# with a package image loaded, we cannot rename that file.
2940
2940
# The code belows append a `_i` to the name of the cache file where `i` is the smallest number such that
2941
2941
# that cache file does not exist.
2942
- ocachename, ocacheext = splitext (ocachefile_orig:: String )
2942
+ ocachename, ocacheext = splitext (ocachefile_orig)
2943
2943
ocachefile_unique = ocachename * " _$num " * ocacheext
2944
2944
ocachefile = rename_unique_ocachefile (tmppath_so, ocachefile_orig, ocachefile_unique, num + 1 )
2945
2945
end
0 commit comments