mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
* 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.
This commit is contained in:
parent
a2b7f40513
commit
fea2af1e9b
18 changed files with 113 additions and 78 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue