summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers/baseparser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/parsers/baseparser.rb')
-rw-r--r--lib/rexml/parsers/baseparser.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index cfcea16f1d..d6e04c7817 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -106,9 +106,11 @@ module REXML
@source = IOSource.new(source)
elsif source.kind_of? Source
@source = source
+ elsif defined? StringIO and source.kind_of? StringIO
+ @source = IOSource.new(source)
else
- raise "#{source.type} is not a valid input stream. It must be \n"+
- "either a String, IO, or Source."
+ raise "#{source.class} is not a valid input stream. It must be \n"+
+ "either a String, IO, StringIO or Source."
end
@closed = nil
@document_status = nil