]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Improve proxy methods with the changes from the abandoned
authorFederico Caselli <cfederico87@gmail.com>
Tue, 18 Oct 2022 17:57:19 +0000 (19:57 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 18 Oct 2022 17:57:19 +0000 (19:57 +0200)
I5c7f172e5224fa08d0675160ac919d0b045a26eb

Change-Id: Ieb7971297f959fd635a4627bd93154e28ef0ef2b

tools/generate_proxy_methods.py

index fd20707844b1e249afe9cd5ac7497b76e60e65df..85f8b2320889a44bef1607de54cfad689c9451e6 100644 (file)
@@ -154,16 +154,19 @@ def _grab_overloads(fn):
             current_ov[:] = []
             break
 
-        fn_match = re.match(r"^    (?:async )?def (.*)\($", line)
+        fn_match = re.match(r"^    (?:    )?(?:async )?def (.*)\($", line)
         if fn_match and fn_match.group(1) != fn.__name__:
             current_ov[:] = []
             break
 
-        ov_match = re.match(r"^    @overload$", line)
+        ov_match = re.match(r"^    (?:    )?@overload$", line)
         if ov_match:
             output.append("".join(reversed(current_ov)))
             current_ov[:] = []
 
+        if re.match(r"^    if (?:typing\.)?TYPE_CHECKING:", line):
+            output.append(line)
+
     output.reverse()
     return output