From: Guido van Rossum Date: Thu, 5 Feb 1998 16:21:28 +0000 (+0000) Subject: (1) Use matchobj.groups(), not matchbj.group() to get all groups. X-Git-Tag: v1.5.1~860 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5d8fed26106d398fc3c0e27fa4c2364f4c40c40;p=thirdparty%2FPython%2Fcpython.git (1) Use matchobj.groups(), not matchbj.group() to get all groups. (2) Provisional hack to avoid dying when trying to turn echo on or off on Macs, where os.system() doesn't exist. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 8ecef031cf0f..35ba479fe22f 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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