aboutsummaryrefslogtreecommitdiffstats
path: root/lib/resolv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r--lib/resolv.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index b38c42ab3f..e52649d32c 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -165,10 +165,10 @@ class Resolv
# Resolv::Hosts is a hostname resolver that uses the system hosts file.
class Hosts
- if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM
+ begin
require 'win32/resolv'
DefaultFileName = Win32::Resolv.get_hosts_path
- else
+ rescue LoadError
DefaultFileName = '/etc/hosts'
end