Fix lstrip bug revealed by B005 lint (#18177)
authorEdward Yang <ezyang@fb.com>
Thu, 21 Mar 2019 14:50:45 +0000 (07:50 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 21 Mar 2019 14:56:24 +0000 (07:56 -0700)
commit9bc8badbcb4414a2f10995980f7158245446ae3c
tree2059dd7fa1688d78d4d147d99459db08b4c29a81
parente5cdd94324832d7e4fa1930302e92fa6501d41e9
Fix lstrip bug revealed by B005 lint (#18177)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18177
ghimport-source-id: fbbf915b66762fc88bc5b541464e71ba27500958

Stack from [ghstack](https://github.com/ezyang/ghstack):
* #18184 Fix B903 lint: save memory for data classes with slots/namedtuple
* #18181 Fix B902 lint error: invalid first argument.
* #18178 Fix B006 lint errors: using mutable structure in default argument.
* **#18177 Fix lstrip bug revealed by B005 lint**

lstrip() doesn't strip a prefix; it strips all of the characters
in the passed in string.  B005 lint revealed this.  Replaced with
substring operation.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Differential Revision: D14530873

fbshipit-source-id: 13b3438fcc3cce13b5110730dc3d0b528a52930f
.flake8
aten/src/ATen/common_with_cwrap.py
torch/_thnn/utils.py