diff --git a/rfc3986/uri.py b/rfc3986/uri.py index 1de3a1a..7d16c8a 100644 --- a/rfc3986/uri.py +++ b/rfc3986/uri.py @@ -69,11 +69,10 @@ class URIReference(namedtuple('URIReference', URI_COMPONENTS)): uri_string = to_str(uri_string, encoding) split_uri = URI_MATCHER.match(uri_string).groupdict() - return URIReference(split_uri['scheme'], split_uri['authority'], - encode_component(split_uri['path'], encoding), - encode_component(split_uri['query'], encoding), - encode_component(split_uri['fragment'], encoding), - encoding) + return cls(split_uri['scheme'], split_uri['authority'], + encode_component(split_uri['path'], encoding), + encode_component(split_uri['query'], encoding), + encode_component(split_uri['fragment'], encoding), encoding) def authority_info(self): """Returns a dictionary with the ``userinfo``, ``host``, and ``port``.