(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.
This commit is contained in:
Guido van Rossum 1998-02-05 16:21:28 +00:00
parent c213078e1e
commit c5d8fed261

View 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