Skip to content

Commit

Permalink
Merge pull request #1978 from rutsky/fix-first-id-None
Browse files Browse the repository at this point in the history
treat Row._next_id=None case as if next id should be 1
  • Loading branch information
rutsky committed Feb 9, 2016
2 parents 50ac6fc + 9889b70 commit 4f54a99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion master/buildbot/test/fake/fakedb.py
Expand Up @@ -106,7 +106,8 @@ def __repr__(self):
return '%s(**%r)' % (self.__class__.__name__, self.values)

def nextId(self):
id, Row._next_id = Row._next_id, (Row._next_id or 1) + 1
id = Row._next_id if Row._next_id is not None else 1
Row._next_id = id + 1
return id

def hashColumns(self, *args):
Expand Down

0 comments on commit 4f54a99

Please sign in to comment.