Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-105232 - misc fixes for python3 #622

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def GetVisualStudioCompilerAndVersion():
# VisualStudioVersion environment variable should be set by the
# Visual Studio Command Prompt.
match = re.search(
"(\d+).(\d+)",
r"(\d+)\.(\d+)",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using python 3 this gives the following warning:

build.py:102: DeprecationWarning: invalid escape sequence \d
      "(\d+).(\d+)",

I believe you got this function from the USD build script. I checked and they made this fix a while ago. The env var has something like "15.0" in it. The r tells python this is a raw string which should not be interpreted. And you need . to find the . otherwise that is the regex matching any char.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh I see. Great find. Didn't realize that.

os.environ.get("VisualStudioVersion", ""))
if match:
return (msvcCompiler, tuple(int(v) for v in match.groups()))
Expand Down
1 change: 0 additions & 1 deletion plugin/al/usdtransaction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ foreach(INPUT_FILE ${PY_INIT_FILES})
get_filename_component(OUTPUT_PATH ${OUTPUT_FILE} DIRECTORY)
install(FILES
${INPUT_FILE} # .py files
${INPUT_FILE}c # .pyc files
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not install .pyc files. They are not needed and they aren't there in python3 anyways.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

DESTINATION ${OUTPUT_PATH}
)
endforeach()
Expand Down