From fea2af1e9b0c99cac6cb8806c4af651a38e92d07 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 4 Jan 1993 09:16:51 +0000 Subject: * More changes due to stricter argument passing rules * Fixed calendar.py, mimetools.py, whrandom.py to cope with time.time() returning a floating point number. (And fix old bug in calendar) * Add recursion level to mainloop.mainloop(), to make it reentrant. --- Lib/regexp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Lib/regexp.py') diff --git a/Lib/regexp.py b/Lib/regexp.py index 2b8a5c00cb..755f65ad7f 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 -- cgit v1.2.1