| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 79a36a5 commit 90dc03d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -203,7 +203,8 @@ def refresh(cls, path=None): | |||
| 203 | 203 | """ | |
| 204 | 204 | # discern which path to refresh with | |
| 205 | 205 | if path is not None: | |
| 206 | - new_git = os.path.abspath(path) | ||
| 206 | + new_git = os.path.expanduser(path) | ||
| 207 | + new_git = os.path.abspath(new_git) | ||
| 207 | 208 | else: | |
| 208 | 209 | new_git = os.environ.get(cls._git_exec_env_var, cls.git_exec_name) | |
| 209 | 210 | ||
@@ -212,14 +213,23 @@ def refresh(cls, path=None): | |||
| 212 | 213 | cls.GIT_PYTHON_GIT_EXECUTABLE = new_git | |
| 213 | 214 | ||
| 214 | 215 | # test if the new git executable path is valid | |
| 216 | + | ||
| 217 | + if sys.version_info < (3,): | ||
| 218 | + # - a GitCommandNotFound error is spawned by ourselves | ||
| 219 | + # - a OSError is spawned if the git executable provided | ||
| 220 | + # cannot be executed for whatever reason | ||
| 221 | + exceptions = (GitCommandNotFound, OSError) | ||
| 222 | + else: | ||
| 223 | + # - a GitCommandNotFound error is spawned by ourselves | ||
| 224 | + # - a PermissionError is spawned if the git executable provided | ||
| 225 | + # cannot be executed for whatever reason | ||
| 226 | + exceptions = (GitCommandNotFound, PermissionError) | ||
| 227 | + | ||
| 215 | 228 | has_git = False | |
| 216 | 229 | try: | |
| 217 | 230 | cls().version() | |
| 218 | 231 | has_git = True | |
| 219 | - except (GitCommandNotFound, PermissionError): | ||
| 220 | - # - a GitCommandNotFound error is spawned by ourselves | ||
| 221 | - # - a PermissionError is spawned if the git executable provided | ||
| 222 | - # cannot be executed for whatever reason | ||
| 232 | + except exceptions: | ||
| 223 | 233 | pass | |
| 224 | 234 | ||
| 225 | 235 | # warn or raise exception if test failed | |
| Back | FazBrowse Home | New Git URL |
0 commit comments