Skip to content

Commit

Permalink
SCons: Fix Godot detection in custom modules logic
Browse files Browse the repository at this point in the history
`exec()` was not a good idea as it assumes a certain type of `version.py` file
similar to Godot's own file, which is not always a reliable assumption (see
#43057 (comment)).

Also restores Python 2 support for the 3.2 branch.
  • Loading branch information
akien-mga committed Feb 11, 2021
1 parent b9863e1 commit 75910d1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ def is_engine(path):
version_path = os.path.join(path, "version.py")
if os.path.exists(version_path):
with open(version_path) as f:
version = {}
exec(f.read(), version)
if version.get("short_name") == "godot":
if 'short_name = "godot"' in f.read():
return True
return False

Expand Down

0 comments on commit 75910d1

Please sign in to comment.