]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(1) Use matchobj.groups(), not matchbj.group() to get all groups.
authorGuido van Rossum <guido@python.org>
Thu, 5 Feb 1998 16:21:28 +0000 (16:21 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 5 Feb 1998 16:21:28 +0000 (16:21 +0000)
(2) Provisional hack to avoid dying when trying to turn echo on or off
on Macs, where os.system() doesn't exist.

Lib/urllib.py

index 8ecef031cf0ff2c14ac4be8d25c4304a06f92fbe..35ba479fe22f40a2d4eba9f168f657d6d7db2993 100644 (file)
@@ -393,7 +393,7 @@ class FancyURLopener(URLopener):
                        match = re.match(
                            '[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
                        if match:
-                               scheme, realm = match.group()
+                               scheme, realm = match.groups()
                                if string.lower(scheme) == 'basic':
                                        return self.retry_http_basic_auth(
                                                url, realm)
@@ -436,11 +436,15 @@ class FancyURLopener(URLopener):
                        return None, None
 
        def echo_off(self):
-               os.system("stty -echo")
+               # XXX Is this sufficient???
+               if hasattr(os, "system"):
+                       os.system("stty -echo")
 
        def echo_on(self):
-               print
-               os.system("stty echo")
+               # XXX Is this sufficient???
+               if hasattr(os, "system"):
+                       print
+                       os.system("stty echo")
 
 
 # Utility functions