Skip to content

Commit

Permalink
Fix mxvalidate to check for stdlib usage (AcademySoftwareFoundation#2122
Browse files Browse the repository at this point in the history
)

Patch `mxvalidate.py` script to avoid trying to access an undefined object `stdlib` if not specified from the command line (default).
  • Loading branch information
kwokcb authored Nov 26, 2024
1 parent cbd9177 commit 344705f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/Scripts/mxvalidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def main():
opts = parser.parse_args()

# Load standard libraries if requested.
stdlib = None
if opts.stdlib:
stdlib = mx.createDocument()
try:
Expand All @@ -29,7 +30,8 @@ def main():
doc = mx.createDocument()
try:
mx.readFromXmlFile(doc, opts.inputFilename)
doc.setDataLibrary(stdlib)
if stdlib:
doc.setDataLibrary(stdlib)
except mx.ExceptionFileMissing as err:
print(err)
sys.exit(0)
Expand Down

0 comments on commit 344705f

Please sign in to comment.