summaryrefslogtreecommitdiff
path: root/lib/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pathname.rb')
-rw-r--r--lib/pathname.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index b7cc01edb3..b21abd746b 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -861,9 +861,9 @@ class Pathname # * mixed *
# <tt>Dir.unlink</tt> as necessary.
def unlink()
begin
- File.unlink @path
- rescue SystemCallError
Dir.unlink @path
+ rescue Errno::ENOTDIR
+ File.unlink @path
end
end
alias delete unlink