Skip to content

Commit

Permalink
Change default session_id to None, because that makes more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed Jan 10, 2014
1 parent c310aee commit 9e0e651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gridmap/job.py
Expand Up @@ -275,7 +275,7 @@ def __init__(self, temp_dir='/scratch'):
# uninitialized field (set in check method)
self.jobs = []
self.ids = []
self.session_id = -1
self.session_id = None
self.id_to_job = {}

def __enter__(self):
Expand All @@ -293,7 +293,7 @@ def __exit__(self, exc_type, exc_value, exc_tb):
self.socket.close()

# Clean up if we have a valid session
if self.session_id != -1:
if self.session_id is not None:
with Session(self.session_id) as session:
# If we encounter an exception, kill all jobs
if exc_type is not None:
Expand Down

0 comments on commit 9e0e651

Please sign in to comment.