Skip to content

Commit 9438565

Browse files
authored
Merge pull request #181 from njzjz/replace_exception
batch replace 'except:' with 'except Exception:'
2 parents e7ce44a + afc2c84 commit 9438565

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dpdispatcher/ssh_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def bind_submission(self, submission):
300300
# sftp = self.ssh_session.ssh.open_sftp()
301301
# sftp.mkdir(self.remote_root)
302302
# sftp.close()
303-
# except:
303+
# except Exception:
304304
# pass
305305

306306
def _walk_directory(self, files, work_path, file_list, directory_list):

tests/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
try:
2525
from dpdispatcher.dp_cloud_server import DpCloudServer
2626
from dpdispatcher.dp_cloud_server_context import DpCloudServerContext
27-
except:
27+
except Exception:
2828
pass
2929
from dpdispatcher.submission import Submission, Job, Task, Resources
3030
from dpdispatcher.machine import Machine

tests/old/test_ssh_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def setUp(self) :
2626
'port': 22,
2727
'username' : getpass.getuser(),
2828
'work_path' : os.path.join(os.getcwd(), 'rmt')})
29-
except:
29+
except Exception:
3030
# for tianhe-2
3131
try:
3232
self.ssh_session = SSHSession({'hostname' : 'localhost',
3333
'port': 5566,
3434
'username' : getpass.getuser(),
3535
'work_path' : os.path.join(os.getcwd(), 'rmt')})
36-
except:
36+
except Exception:
3737
self.skipTest("Network error")
3838
self.job = SSHContext('loc', self.ssh_session)
3939
self.job1 = SSHContext('loc', self.ssh_session, job_uuid = self.job.job_uuid)

tests/shell/test_shell_ssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def setUp(self) :
2424
'port': port,
2525
'username' : getpass.getuser(),
2626
'work_path' : os.path.join(os.getcwd(), 'rmt')})
27-
except:
27+
except Exception:
2828
ssh_session = SSHSession({'hostname' : 'localhost',
2929
'port': 5566,
3030
'username' : getpass.getuser(),

0 commit comments

Comments
 (0)