Skip to content

Commit

Permalink
Fix catchall except statments
Browse files Browse the repository at this point in the history
Enable style check for catchall except statments
Fix up existing problems with catch-all's

fix period

Testing Done:
CI succeeds https://travis-ci.org/pantsbuild/pants/builds/85614655
CI running https://travis-ci.org/pantsbuild/pants/builds/85625910

Bugs closed: 1905, 2374

Reviewed at https://rbcommons.com/s/twitter/r/2971/
  • Loading branch information
digwanderlust authored and stuhood committed Oct 16, 2015
1 parent c7cb8d5 commit 377db83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def run_command(self, cmd, workunit):
subprocess.check_call(cmd, stdout=workunit.output('stdout'), stderr=workunit.output('stderr'))
except subprocess.CalledProcessError as e:
raise TaskError('Execution failed: {0}'.format(e))
except:
raise TaskError('Failed to execute {0}'.format(cmd))

@property
def cpp_toolchain(self):
Expand Down
3 changes: 0 additions & 3 deletions pants.ini
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ skip: True
[pycheck-context-manager]
skip: True

[pycheck-except-statement]
skip: True


[compile.zinc]
worker_count: 4
Expand Down
10 changes: 5 additions & 5 deletions src/python/pants/goal/run_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,19 @@ def new_workunit_under_parent(self, name, parent, labels=None, cmd='', log_confi
workunit = WorkUnit(run_info_dir=self.run_info_dir, parent=parent, name=name, labels=labels,
cmd=cmd, log_config=log_config)
workunit.start()

outcome = WorkUnit.FAILURE # Default to failure we will override if we get success/abort.
try:
self.report.start_workunit(workunit)
yield workunit
except KeyboardInterrupt:
workunit.set_outcome(WorkUnit.ABORTED)
outcome = WorkUnit.ABORTED
self._aborted = True
raise
except:
workunit.set_outcome(WorkUnit.FAILURE)
raise
else:
workunit.set_outcome(WorkUnit.SUCCESS)
outcome = WorkUnit.SUCCESS
finally:
workunit.set_outcome(outcome)
self.end_workunit(workunit)

def log(self, level, *msg_elements):
Expand Down

0 comments on commit 377db83

Please sign in to comment.