Commit c5d8fed2 authored by Guido van Rossum's avatar Guido van Rossum

(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.
parent c213078e
...@@ -393,7 +393,7 @@ class FancyURLopener(URLopener): ...@@ -393,7 +393,7 @@ class FancyURLopener(URLopener):
match = re.match( match = re.match(
'[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) '[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
if match: if match:
scheme, realm = match.group() scheme, realm = match.groups()
if string.lower(scheme) == 'basic': if string.lower(scheme) == 'basic':
return self.retry_http_basic_auth( return self.retry_http_basic_auth(
url, realm) url, realm)
...@@ -436,11 +436,15 @@ class FancyURLopener(URLopener): ...@@ -436,11 +436,15 @@ class FancyURLopener(URLopener):
return None, None return None, None
def echo_off(self): def echo_off(self):
os.system("stty -echo") # XXX Is this sufficient???
if hasattr(os, "system"):
os.system("stty -echo")
def echo_on(self): def echo_on(self):
print # XXX Is this sufficient???
os.system("stty echo") if hasattr(os, "system"):
print
os.system("stty echo")
# Utility functions # Utility functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment