summaryrefslogtreecommitdiffstats
path: root/Lib/regexp.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/regexp.py')
-rw-r--r--Lib/regexp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/regexp.py b/Lib/regexp.py
index 2b8a5c0..755f65a 100644
--- a/Lib/regexp.py
+++ b/Lib/regexp.py
@@ -11,11 +11,13 @@ class Prog:
finally:
xxx = regex.set_syntax(save_syntax)
return self
- def match(self, args):
- if type(args) == type(()):
+ def match(self, *args):
+ if len(args) == 2:
str, offset = args
+ elif len(args) == 1:
+ str, offset = args[0], 0
else:
- str, offset = args, 0
+ raise TypeError, 'wrong argument count'
if self.prog.search(str, offset) < 0:
return ()
regs = self.prog.regs