summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-02-05 16:21:28 (GMT)
committerGuido van Rossum <guido@python.org>1998-02-05 16:21:28 (GMT)
commitc5d8fed26106d398fc3c0e27fa4c2364f4c40c40 (patch)
tree2011626105c63b66e739d89a21707c9289033dae
parentc213078e1e33880ec8cefc54e6d3f4f6e707c151 (diff)
downloadcpython-c5d8fed26106d398fc3c0e27fa4c2364f4c40c40.zip
cpython-c5d8fed26106d398fc3c0e27fa4c2364f4c40c40.tar.gz
cpython-c5d8fed26106d398fc3c0e27fa4c2364f4c40c40.tar.bz2
(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.
-rw-r--r--Lib/urllib.py12
1 files 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