mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
(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:
parent
c213078e1e
commit
c5d8fed261
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue