Fix Issue9301 - urllib.parse.unquote and unquote_to_byte to raise TypeError for None.
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index 82edea1..691c004 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -314,6 +314,8 @@
     # Note: strings are encoded as UTF-8. This is only an issue if it contains
     # unescaped non-ASCII characters, which URIs should not.
     if not string:
+        if string is None:
+            raise TypeError('None object is invalid for unquote_to_bytes()')
         return b''
     if isinstance(string, str):
         string = string.encode('utf-8')
@@ -339,6 +341,8 @@
     unquote('abc%20def') -> 'abc def'.
     """
     if not string:
+        if string is None:
+            raise TypeError('None object is invalid for unquote() function.')
         return string
     res = string.split('%')
     if len(res) == 1: