summaryrefslogtreecommitdiff
path: root/rdflib/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdflib/parser.py')
-rw-r--r--rdflib/parser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rdflib/parser.py b/rdflib/parser.py
index 45915b45..6ada9dac 100644
--- a/rdflib/parser.py
+++ b/rdflib/parser.py
@@ -102,7 +102,8 @@ class URLInputSource(InputSource):
self.url = file.geturl() # in case redirections took place
self.setPublicId(self.url)
self.content_type = file.info().get('content-type')
- self.content_type = self.content_type.split(";", 1)[0]
+ if self.content_type is not None:
+ self.content_type = self.content_type.split(";", 1)[0]
self.setByteStream(file)
# TODO: self.setEncoding(encoding)
self.response_info = file.info() # a mimetools.Message instance