Skip to content

Commit

Permalink
fix: detecting comments as parameters sets when they have =.
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Nov 29, 2024
1 parent 2072976 commit c69cd3e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ansys/mapdl/core/mapdl_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,8 @@ def run(

command = command.strip()

is_comment = command.startswith("!") or command.upper().startswith("/COM")

# always reset the cache
self._reset_cache()

Expand Down Expand Up @@ -2261,7 +2263,7 @@ def run(
# simply return the contents of the file
return self.list(*command.split(",")[1:])

if "=" in command:
if "=" in command and not is_comment:
# We are storing a parameter.
param_name = command.split("=")[0].strip()

Expand Down Expand Up @@ -2873,11 +2875,6 @@ def _raise_output_errors(self, response):
[each for each in error_message.splitlines() if each]
)

# Trimming empty lines
error_message = "\n".join(
[each for each in error_message.splitlines() if each]
)

# Checking for permitted error.
for each_error in _PERMITTED_ERRORS:
permited_error_message = re.search(each_error, error_message)
Expand Down

0 comments on commit c69cd3e

Please sign in to comment.