Skip to content

Commit

Permalink
[bugfix] Fix error when the script in on another disk (#5606)
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiliin authored Jun 9, 2024
1 parent 790eb70 commit f96968d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/abqpy/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def run(cae: bool = True) -> None:
main = sys.modules["__main__"]
if not hasattr(main, "__file__") or main.__file__ is None:
raise RuntimeError("Cannot find the main script file, please run the script in a file.")
filePath = os.path.relpath(main.__file__)

try:
filePath = os.path.relpath(main.__file__)
except ValueError:
filePath = main.__file__

# Alternative to use abaqus command line options at run time
print("The script will be submitted to Abaqus next and the current Python session will be closed.")
Expand Down

0 comments on commit f96968d

Please sign in to comment.