{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/pip/pulls/comments/42821984","id":42821984,"diff_hunk":"@@ -249,11 +249,10 @@ def add_requirement(self, install_req, parent_req_name=None):\n                     self.requirement_aliases[name.lower()] = name\n                 result = [install_req]\n             else:\n-                if not existing_req.constraint:\n-                    # No need to scan, we've already encountered this for\n-                    # scanning.\n-                    result = []\n-                elif not install_req.constraint:\n+                # Assume there's no need to scan, and that we've already\n+                # encountered this for scanning.\n+                result = []\n+                if not install_req.constraint:","path":"pip/req/req_set.py","position":12,"original_position":12,"commit_id":"10b52529dcd58905a94eec3aa5ee9d310fc022bd","original_commit_id":"10b52529dcd58905a94eec3aa5ee9d310fc022bd","user":{"login":"cloudnull","id":2066292,"avatar_url":"https://avatars.githubusercontent.com/u/2066292?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudnull","html_url":"https://github.com/cloudnull","followers_url":"https://api.github.com/users/cloudnull/followers","following_url":"https://api.github.com/users/cloudnull/following{/other_user}","gists_url":"https://api.github.com/users/cloudnull/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudnull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudnull/subscriptions","organizations_url":"https://api.github.com/users/cloudnull/orgs","repos_url":"https://api.github.com/users/cloudnull/repos","events_url":"https://api.github.com/users/cloudnull/events{/privacy}","received_events_url":"https://api.github.com/users/cloudnull/received_events","type":"User","site_admin":false},"body":"@xavfernandez  that makes sense, let me update the PR.","created_at":"2015-10-23T00:13:02Z","updated_at":"2015-10-23T00:13:02Z","html_url":"https://github.com/pypa/pip/pull/3179#discussion_r42821984","pull_request_url":"https://api.github.com/repos/pypa/pip/pulls/3179","_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments/42821984"},"html":{"href":"https://github.com/pypa/pip/pull/3179#discussion_r42821984"},"pull_request":{"href":"https://api.github.com/repos/pypa/pip/pulls/3179"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/pip/pulls/3179","id":47495334,"html_url":"https://github.com/pypa/pip/pull/3179","diff_url":"https://github.com/pypa/pip/pull/3179.diff","patch_url":"https://github.com/pypa/pip/pull/3179.patch","issue_url":"https://api.github.com/repos/pypa/pip/issues/3179","number":3179,"state":"open","locked":false,"title":"Resolves result obj in req_constraints","user":{"login":"cloudnull","id":2066292,"avatar_url":"https://avatars.githubusercontent.com/u/2066292?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudnull","html_url":"https://github.com/cloudnull","followers_url":"https://api.github.com/users/cloudnull/followers","following_url":"https://api.github.com/users/cloudnull/following{/other_user}","gists_url":"https://api.github.com/users/cloudnull/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudnull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudnull/subscriptions","organizations_url":"https://api.github.com/users/cloudnull/orgs","repos_url":"https://api.github.com/users/cloudnull/repos","events_url":"https://api.github.com/users/cloudnull/events{/privacy}","received_events_url":"https://api.github.com/users/cloudnull/received_events","type":"User","site_admin":false},"body":"The changes resolves a condition that can lead to a stacktrace due to the \r\nuse of constraint files. There are conditions where the result object may be\r\nleft undefined which causes the problems\r\n\r\n**Example of the traceback**\r\n``` traceback\r\n  Exception:\r\n  Traceback (most recent call last):\r\n    File \"/usr/local/lib/python2.7/dist-packages/pip/basecommand.py\", line 211, in main\r\n      status = self.run(options, args)\r\n    File \"/usr/local/lib/python2.7/dist-packages/pip/commands/wheel.py\", line 180, in run\r\n      wheel_cache\r\n    File \"/usr/local/lib/python2.7/dist-packages/pip/basecommand.py\", line 266, in populate_requirement_set\r\n      requirement_set.add_requirement(req)\r\n    File \"/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py\", line 267, in add_requirement\r\n      return result\r\n  UnboundLocalError: local variable 'result' referenced before assignment\r\n```\r\n\r\nThis change simply ensures that the 'result' object is a defined\r\nwhen the method returns\r\n\r\nSigned-off-by: Kevin Carter <kevin.carter@rackspace.com>","created_at":"2015-10-13T06:28:51Z","updated_at":"2015-10-23T00:13:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7067c1cb1fe39be5b469f49bf01bc6f61435442b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pypa/pip/pulls/3179/commits","review_comments_url":"https://api.github.com/repos/pypa/pip/pulls/3179/comments","review_comment_url":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/pip/issues/3179/comments","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/10b52529dcd58905a94eec3aa5ee9d310fc022bd","head":{"label":"cloudnull:fix/req_constraint","ref":"fix/req_constraint","sha":"10b52529dcd58905a94eec3aa5ee9d310fc022bd","user":{"login":"cloudnull","id":2066292,"avatar_url":"https://avatars.githubusercontent.com/u/2066292?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudnull","html_url":"https://github.com/cloudnull","followers_url":"https://api.github.com/users/cloudnull/followers","following_url":"https://api.github.com/users/cloudnull/following{/other_user}","gists_url":"https://api.github.com/users/cloudnull/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudnull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudnull/subscriptions","organizations_url":"https://api.github.com/users/cloudnull/orgs","repos_url":"https://api.github.com/users/cloudnull/repos","events_url":"https://api.github.com/users/cloudnull/events{/privacy}","received_events_url":"https://api.github.com/users/cloudnull/received_events","type":"User","site_admin":false},"repo":{"id":44154947,"name":"pip","full_name":"cloudnull/pip","owner":{"login":"cloudnull","id":2066292,"avatar_url":"https://avatars.githubusercontent.com/u/2066292?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudnull","html_url":"https://github.com/cloudnull","followers_url":"https://api.github.com/users/cloudnull/followers","following_url":"https://api.github.com/users/cloudnull/following{/other_user}","gists_url":"https://api.github.com/users/cloudnull/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudnull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudnull/subscriptions","organizations_url":"https://api.github.com/users/cloudnull/orgs","repos_url":"https://api.github.com/users/cloudnull/repos","events_url":"https://api.github.com/users/cloudnull/events{/privacy}","received_events_url":"https://api.github.com/users/cloudnull/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cloudnull/pip","description":"The PyPA recommended tool for installing Python packages","fork":true,"url":"https://api.github.com/repos/cloudnull/pip","forks_url":"https://api.github.com/repos/cloudnull/pip/forks","keys_url":"https://api.github.com/repos/cloudnull/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudnull/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudnull/pip/teams","hooks_url":"https://api.github.com/repos/cloudnull/pip/hooks","issue_events_url":"https://api.github.com/repos/cloudnull/pip/issues/events{/number}","events_url":"https://api.github.com/repos/cloudnull/pip/events","assignees_url":"https://api.github.com/repos/cloudnull/pip/assignees{/user}","branches_url":"https://api.github.com/repos/cloudnull/pip/branches{/branch}","tags_url":"https://api.github.com/repos/cloudnull/pip/tags","blobs_url":"https://api.github.com/repos/cloudnull/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudnull/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudnull/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudnull/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudnull/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudnull/pip/languages","stargazers_url":"https://api.github.com/repos/cloudnull/pip/stargazers","contributors_url":"https://api.github.com/repos/cloudnull/pip/contributors","subscribers_url":"https://api.github.com/repos/cloudnull/pip/subscribers","subscription_url":"https://api.github.com/repos/cloudnull/pip/subscription","commits_url":"https://api.github.com/repos/cloudnull/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudnull/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudnull/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudnull/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudnull/pip/contents/{+path}","compare_url":"https://api.github.com/repos/cloudnull/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudnull/pip/merges","archive_url":"https://api.github.com/repos/cloudnull/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudnull/pip/downloads","issues_url":"https://api.github.com/repos/cloudnull/pip/issues{/number}","pulls_url":"https://api.github.com/repos/cloudnull/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudnull/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudnull/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudnull/pip/labels{/name}","releases_url":"https://api.github.com/repos/cloudnull/pip/releases{/id}","created_at":"2015-10-13T05:51:02Z","updated_at":"2015-10-13T05:51:05Z","pushed_at":"2015-10-13T06:18:23Z","git_url":"git://github.com/cloudnull/pip.git","ssh_url":"git@github.com:cloudnull/pip.git","clone_url":"https://github.com/cloudnull/pip.git","svn_url":"https://github.com/cloudnull/pip","homepage":"https://pip.pypa.io/","size":38389,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"pypa:develop","ref":"develop","sha":"13d43e3af8b5c8e8c7c66dde8a9f76b340697c3e","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":1446467,"name":"pip","full_name":"pypa/pip","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypa/pip","description":"The PyPA recommended tool for installing Python packages","fork":false,"url":"https://api.github.com/repos/pypa/pip","forks_url":"https://api.github.com/repos/pypa/pip/forks","keys_url":"https://api.github.com/repos/pypa/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/pip/teams","hooks_url":"https://api.github.com/repos/pypa/pip/hooks","issue_events_url":"https://api.github.com/repos/pypa/pip/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/pip/events","assignees_url":"https://api.github.com/repos/pypa/pip/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/pip/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/pip/tags","blobs_url":"https://api.github.com/repos/pypa/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/pip/languages","stargazers_url":"https://api.github.com/repos/pypa/pip/stargazers","contributors_url":"https://api.github.com/repos/pypa/pip/contributors","subscribers_url":"https://api.github.com/repos/pypa/pip/subscribers","subscription_url":"https://api.github.com/repos/pypa/pip/subscription","commits_url":"https://api.github.com/repos/pypa/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/pip/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/pip/merges","archive_url":"https://api.github.com/repos/pypa/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/pip/downloads","issues_url":"https://api.github.com/repos/pypa/pip/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/pip/labels{/name}","releases_url":"https://api.github.com/repos/pypa/pip/releases{/id}","created_at":"2011-03-06T14:30:46Z","updated_at":"2015-10-22T16:55:26Z","pushed_at":"2015-10-22T22:04:49Z","git_url":"git://github.com/pypa/pip.git","ssh_url":"git@github.com:pypa/pip.git","clone_url":"https://github.com/pypa/pip.git","svn_url":"https://github.com/pypa/pip","homepage":"https://pip.pypa.io/","size":55606,"stargazers_count":2390,"watchers_count":2390,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":946,"mirror_url":null,"open_issues_count":622,"forks":946,"open_issues":622,"watchers":2390,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/3179"},"html":{"href":"https://github.com/pypa/pip/pull/3179"},"issue":{"href":"https://api.github.com/repos/pypa/pip/issues/3179"},"comments":{"href":"https://api.github.com/repos/pypa/pip/issues/3179/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/pip/pulls/3179/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/pip/pulls/3179/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/pip/statuses/10b52529dcd58905a94eec3aa5ee9d310fc022bd"}}}}