diff options
author | Erik Rose <grinch@grinchcentral.com> | 2012-06-01 17:56:18 -0700 |
---|---|---|
committer | Erik Rose <grinch@grinchcentral.com> | 2012-06-01 18:01:43 -0700 |
commit | 0f19539b5f87366bb2833f5a91311df72a1d4894 (patch) | |
tree | 9138fca759ca2e8c50562b2970081fda7c9b3d22 /blessings/__init__.py | |
parent | 103f089a2081a83a1d0fc471c2aa484ce30da407 (diff) | |
download | blessings-0f19539b5f87366bb2833f5a91311df72a1d4894.tar.gz |
Fix a bug where location() wouldn't do anything when passed 0s.
Diffstat (limited to 'blessings/__init__.py')
-rw-r--r-- | blessings/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/blessings/__init__.py b/blessings/__init__.py index dbd4b69..6f8c107 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -448,11 +448,11 @@ class Location(object): def __enter__(self): """Save position and move to the requested column, row, or both.""" self.term.stream.write(self.term.save) # save position - if self.x and self.y: + if self.x is not None and self.y is not None: self.term.stream.write(self.term.move(self.y, self.x)) - elif self.x: + elif self.x is not None: self.term.stream.write(self.term.move_x(self.x)) - elif self.y: + elif self.y is not None: self.term.stream.write(self.term.move_y(self.y)) def __exit__(self, type, value, tb): |