Add begin/rescue/end to setcode block

This silences these warnings:

Could not retrieve pip_version: undefined method `[]' for nil:NilClass
Could not retrieve pip_version: can't convert Symbol into String
Add begin/rescue/end to setcode block

This silences these warnings:

Could not retrieve pip_version: undefined method `[]' for nil:NilClass
Could not retrieve pip_version: can't convert Symbol into String