| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8ab311b commit 6fa9500
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ | |||
| 13 | 13 | # limitations under the License. | |
| 14 | 14 | ||
| 15 | 15 | import json | |
| 16 | + import pathlib | ||
| 16 | 17 | import re | |
| 17 | 18 | import subprocess | |
| 18 | 19 | from sys import stderr | |
@@ -359,6 +360,8 @@ def serialize_python_type(self, value: Any, direction: str) -> str: | |||
| 359 | 360 | match = re.match(r"^<class '((?:pathlib\.)?\w+)'>$", str_value) | |
| 360 | 361 | if match: | |
| 361 | 362 | return match.group(1) | |
| 363 | + if str_value == str(pathlib.Path): | ||
| 364 | + return "pathlib.Path" | ||
| 362 | 365 | match = re.match( | |
| 363 | 366 | r"playwright._impl._event_context_manager.EventContextManagerImpl\[playwright._impl.[^.]+.(.*)\]", | |
| 364 | 367 | str_value, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,6 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | 58 | def process_type(value: Any, param: bool = False) -> str: | |
| 59 | 59 | value = str(value) | |
| 60 | + value = re.sub("pathlib._local.Path", "pathlib.Path", value) | ||
| 60 | 61 | value = re.sub(r"<class '([^']+)'>", r"\1", value) | |
| 61 | 62 | value = re.sub(r"NoneType", "None", value) | |
| 62 | 63 | value = re.sub(r"playwright\._impl\._api_structures.([\w]+)", r"\1", value) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments