From 72ab665b7849e3aa85c5bf08efb1ba380dda3546 Mon Sep 17 00:00:00 2001 From: lyuwenyu Date: Wed, 12 May 2021 10:59:06 +0800 Subject: [PATCH] update comments --- hubconf.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hubconf.py b/hubconf.py index 6e580761..84ae3a3e 100644 --- a/hubconf.py +++ b/hubconf.py @@ -20,6 +20,15 @@ import sys class _SysPathG(object): + """ + _SysPathG used to add/clean path for sys.path. Making sure minimal pkgs dependents by skiping parent dirs. + + __enter__ + add path into sys.path + __exit__ + clean user's sys.path to avoid unexpect behaviors + """ + def __init__(self, path): self.path = path @@ -28,7 +37,8 @@ class _SysPathG(object): def __exit__(self, type, value, traceback): _p = sys.path.pop(0) - assert _p == self.path, 'make sure pop {} correctly.'.format(self.path) + assert _p == self.path, 'Make sure sys.path cleaning {} correctly.'.format( + self.path) with _SysPathG( -- GitLab