~vcs-imports/reviewboard/trunk

Viewing all changes in revision 4769.

  • Committer: Barret Rennie
  • Date: 2019-09-10 20:18:52 UTC
  • Revision ID: git-v1:79b5aac7089a494e8cb99a4a581ad3c6e3984335
Fix prepare-dev.py hook installation on Python 3

There were two issues in the implementation of `install_git_hooks` that
prevented it from working on Python 3:
- an old-style (0777) octal literal was used instead of a new-style one
  (0o777): old-style literals are not supported on Python 3; and
- bytes and unicode were being mixed in `os.path.join`, which is not an
  issue in Python 2 but is on Python 3.

Since `prepare-dev.py` is intended to install dependencies, we can't
assume the presence of `six`, so we determine the correct string type
manually.

Testing Done:
Ran prepare-dev.py under Python 2 and Python 3 and it created git
hooks successfully.

Reviewed at https://reviews.reviewboard.org/r/10680/

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: