1# Copyright 2015 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import imp 6 7def FindModule(name): 8 """Gets the path of the named module. 9 10 This is useful for cases where we want to use subprocess.call on a module we 11 have imported, and safer than using __file__ since that can point to .pyc 12 files. 13 14 Args: 15 name: the string name of a module (e.g. 'dev_appserver') 16 Returns: 17 The path to the module. 18 """ 19 return imp.find_module(name)[1] 20