From 8eee78b9ab15148e7243b65e2487dba4c4c74e9e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 4 Oct 2006 14:55:11 +0000 Subject: [PATCH] Translate null-argument methods correctly. --- ctopy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ctopy b/ctopy index d7dd777..293eb69 100755 --- a/ctopy +++ b/ctopy @@ -736,8 +736,15 @@ def ctopy(input): importlist.append(module) for (fro, to, module) in methodmappings: if re.search(r"\b" + fro + r"\b\(", regions[i]): - regions[i] = re.sub(r"\b" + fro + r"\b\(([^,]*),\s*", - r"\1." + to + "(", regions[i]) + singlearg = r"\b"+fro+(r"\b\((%(exp)s)\)"%shorthands) + if re.search(singlearg, regions[i]): + regions[i] = re.sub(singlearg, + r"\1." + to +"()", + regions[i]) + else: + regions[i] = re.sub(r"\b"+fro+r"\b\(([^,]*),\s*", + r"\1." + to + "(", + regions[i]) if module not in importlist: importlist.append(module) if debug >= 2: -- 2.43.0