From 481285625be75bc02455166911c46317d6aa5b50 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Sat, 2 Apr 2016 16:02:04 +0200 Subject: [PATCH] REFACTOR simplify out-of-bounds-check in control() --- escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index efc9a16..6b819a4 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -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))