當前位置: 首頁>>代碼示例>>Python>>正文


Python backwardcompat.get_path_uid方法代碼示例

本文整理匯總了Python中pip.backwardcompat.get_path_uid方法的典型用法代碼示例。如果您正苦於以下問題:Python backwardcompat.get_path_uid方法的具體用法?Python backwardcompat.get_path_uid怎麽用?Python backwardcompat.get_path_uid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pip.backwardcompat的用法示例。


在下文中一共展示了backwardcompat.get_path_uid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _get_build_prefix

# 需要導入模塊: from pip import backwardcompat [as 別名]
# 或者: from pip.backwardcompat import get_path_uid [as 別名]
def _get_build_prefix():
    """ Returns a safe build_prefix """
    path = os.path.join(tempfile.gettempdir(), 'pip_build_%s' %
        __get_username())
    if sys.platform == 'win32':
        """ on windows(tested on 7) temp dirs are isolated """
        return path
    try:
        os.mkdir(path)
        write_delete_marker_file(path)
    except OSError:
        file_uid = None
        try:
            # raises OSError for symlinks
            # https://github.com/pypa/pip/pull/935#discussion_r5307003
            file_uid = get_path_uid(path)
        except OSError:
            file_uid = None

        if file_uid != os.geteuid():
            msg = "The temporary folder for building (%s) is either not owned by you, or is a symlink." \
                % path
            print (msg)
            print("pip will not work until the temporary folder is " + \
                 "either deleted or is a real directory owned by your user account.")
            raise pip.exceptions.InstallationError(msg)
    return path 
開發者ID:sugarguo,項目名稱:Flask_Blog,代碼行數:29,代碼來源:locations.py


注:本文中的pip.backwardcompat.get_path_uid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。