Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: vpython/venv/venv_test.go

Issue 2925723004: [vpython] Implement smart probing. (Closed)
Patch Set: sentinel text Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « vpython/venv/config.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package venv 5 package venv
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "flag" 9 "flag"
10 "fmt" 10 "fmt"
(...skipping 29 matching lines...) Expand all
40 return c 40 return c
41 } 41 }
42 42
43 type resolvedInterpreter struct { 43 type resolvedInterpreter struct {
44 py *python.Interpreter 44 py *python.Interpreter
45 version python.Version 45 version python.Version
46 } 46 }
47 47
48 func resolveFromPath(vers python.Version) *resolvedInterpreter { 48 func resolveFromPath(vers python.Version) *resolvedInterpreter {
49 c := testContext() 49 c := testContext()
50 » py, err := python.Find(c, vers) 50 » py, err := python.Find(c, vers, nil)
51 if err != nil { 51 if err != nil {
52 return nil 52 return nil
53 } 53 }
54 if err := filesystem.AbsPath(&py.Python); err != nil { 54 if err := filesystem.AbsPath(&py.Python); err != nil {
55 panic(err) 55 panic(err)
56 } 56 }
57 57
58 ri := resolvedInterpreter{ 58 ri := resolvedInterpreter{
59 py: py, 59 py: py,
60 } 60 }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 path := actual.(string) 279 path := actual.(string)
280 switch _, err := os.Stat(path); { 280 switch _, err := os.Stat(path); {
281 case err == nil: 281 case err == nil:
282 return fmt.Sprintf("Path %q should not exist, but it does.", pat h) 282 return fmt.Sprintf("Path %q should not exist, but it does.", pat h)
283 case os.IsNotExist(err): 283 case os.IsNotExist(err):
284 return "" 284 return ""
285 default: 285 default:
286 return fmt.Sprintf("Couldn't check if %q exists: %s", path, err) 286 return fmt.Sprintf("Couldn't check if %q exists: %s", path, err)
287 } 287 }
288 } 288 }
OLDNEW
« no previous file with comments | « vpython/venv/config.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698