| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,3 +14,4 @@ nbproject | |||
| 14 | 14 | .DS_Store | |
| 15 | 15 | /*egg-info | |
| 16 | 16 | /.tox | |
| 17 | + .idea | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -309,5 +309,5 @@ def register_surrogateescape(): | |||
| 309 | 309 | ||
| 310 | 310 | try: | |
| 311 | 311 | b"100644 \x9f\0aaa".decode(defenc, "surrogateescape") | |
| 312 | - except: | ||
| 312 | + except Exception: | ||
| 313 | 313 | register_surrogateescape() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -313,16 +313,16 @@ def __str__(self): | |||
| 313 | 313 | h %= self.b_blob.path | |
| 314 | 314 | ||
| 315 | 315 | msg = '' | |
| 316 | - l = None # temp line | ||
| 316 | + temp_line = None | ||
| 317 | 317 | ll = 0 # line length | |
| 318 | 318 | for b, n in zip((self.a_blob, self.b_blob), ('lhs', 'rhs')): | |
| 319 | 319 | if b: | |
| 320 | - l = "\n%s: %o | %s" % (n, b.mode, b.hexsha) | ||
| 320 | + temp_line = "\n%s: %o | %s" % (n, b.mode, b.hexsha) | ||
| 321 | 321 | else: | |
| 322 | - l = "\n%s: None" % n | ||
| 322 | + temp_line = "\n%s: None" % n | ||
| 323 | 323 | # END if blob is not None | |
| 324 | - ll = max(len(l), ll) | ||
| 325 | - msg += l | ||
| 324 | + ll = max(len(temp_line), ll) | ||
| 325 | + msg += temp_line | ||
| 326 | 326 | # END for each blob | |
| 327 | 327 | ||
| 328 | 328 | # add headline | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ def __init__(self, command, status=None, stderr=None, stdout=None): | |||
| 48 | 48 | else: | |
| 49 | 49 | try: | |
| 50 | 50 | status = u'exit code(%s)' % int(status) | |
| 51 | - except: | ||
| 51 | + except Exception: | ||
| 52 | 52 | s = safe_decode(str(status)) | |
| 53 | 53 | status = u"'%s'" % s if isinstance(status, string_types) else s | |
| 54 | 54 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -246,7 +246,7 @@ def to_file(self, filepath): | |||
| 246 | 246 | try: | |
| 247 | 247 | self._serialize(fp) | |
| 248 | 248 | lfd.commit() | |
| 249 | - except: | ||
| 249 | + except Exception: | ||
| 250 | 250 | # on failure it rolls back automatically, but we make it clear | |
| 251 | 251 | lfd.rollback() | |
| 252 | 252 | raise | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -542,9 +542,11 @@ def urls(self): | |||
| 542 | 542 | if ' Push URL:' in line: | |
| 543 | 543 | yield line.split(': ')[-1] | |
| 544 | 544 | except GitCommandError as ex: | |
| 545 | - if any([msg in str(ex) for msg in ['correct access rights','cannot run ssh']]): | ||
| 546 | - # If ssh is not setup to access this repository, see issue 694 | ||
| 547 | - result = Git().execute(['git','config','--get','remote.%s.url' % self.name]) | ||
| 545 | + if any([msg in str(ex) for msg in ['correct access rights', | ||
| 546 | + 'cannot run ssh']]): | ||
| 547 | + # If ssh is not setup to access this repository, see issue 694 | ||
| 548 | + result = Git().execute(['git', 'config', '--get', | ||
| 549 | + 'remote.%s.url' % self.name]) | ||
| 548 | 550 | yield result | |
| 549 | 551 | else: | |
| 550 | 552 | raise ex | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -203,7 +203,7 @@ def __exit__(self, exc_type, exc_value, traceback): | |||
| 203 | 203 | def __del__(self): | |
| 204 | 204 | try: | |
| 205 | 205 | self.close() | |
| 206 | - except: | ||
| 206 | + except Exception: | ||
| 207 | 207 | pass | |
| 208 | 208 | ||
| 209 | 209 | def close(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -139,7 +139,7 @@ def repo_creator(self): | |||
| 139 | 139 | try: | |
| 140 | 140 | try: | |
| 141 | 141 | return func(self, rw_repo) | |
| 142 | - except: | ||
| 142 | + except Exception: | ||
| 143 | 143 | log.info("Keeping repo after failure: %s", repo_dir) | |
| 144 | 144 | repo_dir = None | |
| 145 | 145 | raise | |
@@ -296,7 +296,7 @@ def remote_repo_creator(self): | |||
| 296 | 296 | with cwd(rw_repo.working_dir): | |
| 297 | 297 | try: | |
| 298 | 298 | return func(self, rw_repo, rw_daemon_repo) | |
| 299 | - except: | ||
| 299 | + except Exception: | ||
| 300 | 300 | log.info("Keeping repos after failure: \n rw_repo_dir: %s \n rw_daemon_repo_dir: %s", | |
| 301 | 301 | rw_repo_dir, rw_daemon_repo_dir) | |
| 302 | 302 | rw_repo_dir = rw_daemon_repo_dir = None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -169,8 +169,8 @@ def test_traversal(self): | |||
| 169 | 169 | # at some point, both iterations should stop | |
| 170 | 170 | self.assertEqual(list(bfirst)[-1], first) | |
| 171 | 171 | stoptraverse = self.rorepo.commit("254d04aa3180eb8b8daf7b7ff25f010cd69b4e7d").traverse(as_edge=True) | |
| 172 | - l = list(stoptraverse) | ||
| 173 | - self.assertEqual(len(l[0]), 2) | ||
| 172 | + traverse_list = list(stoptraverse) | ||
| 173 | + self.assertEqual(len(traverse_list[0]), 2) | ||
| 174 | 174 | ||
| 175 | 175 | # ignore self | |
| 176 | 176 | self.assertEqual(next(start.traverse(ignore_self=False)), start) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -920,4 +920,4 @@ class Repo(object): | |||
| 920 | 920 | submodule_path = 'D:\\submodule_path' | |
| 921 | 921 | relative_path = Submodule._to_relative_path(super_repo, submodule_path) | |
| 922 | 922 | msg = '_to_relative_path should be "submodule_path" but was "%s"' % relative_path | |
| 923 | - assert relative_path == 'submodule_path', msg | ||
| 923 | + assert relative_path == 'submodule_path', msg | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments