From c5d8fed26106d398fc3c0e27fa4c2364f4c40c40 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 5 Feb 1998 16:21:28 +0000 Subject: (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. --- Lib/urllib.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index 8ecef03..35ba479 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 -- cgit v0.12