Skip to content

Commit

Permalink
[Lang] Fix a bug on PosixPath (taichi-dev#7860)
Browse files Browse the repository at this point in the history
When calling `ti gallery,` the `_exec_python_file` function in
`_main.py` simply passes a `pathlib.PosixPath` object to the command.
This may cause problems on Windows platforms. This PR fixes this issue
by forcing using the absolute string path.
  • Loading branch information
neozhaoliang authored and quadpixels committed May 13, 2023
1 parent 2f61eda commit 4e0c379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/taichi/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def on_mouse_click_callback(example_name):
content = Syntax.from_path(script, line_numbers=True)
console = rich.console.Console()
console.print(content)
self._exec_python_file(script)
self._exec_python_file(str(script))

index = None
while not gui.get_event(ti.GUI.ESCAPE, ti.GUI.EXIT):
Expand Down

0 comments on commit 4e0c379

Please sign in to comment.