REFACTOR simplify out-of-bounds-check in control()

This commit is contained in:
Patrick Kanzler 2016-04-02 16:02:04 +02:00
parent 1ee657a750
commit 481285625b
No known key found for this signature in database
GPG Key ID: F07F07153306FCEF
1 changed files with 1 additions and 1 deletions

View File

@ -669,7 +669,7 @@ class Escpos(object):
:raises: :py:exc:`~escpos.exceptions.TabPosError`
"""
# Set tab positions
if pos < 1 or pos > 16:
if not (1 <= pos <= 16):
raise TabPosError()
else:
self._raw(CTL_SET_HT + six.int2byte(pos))