From f39512aa639558e8b3cac6e1a9d717201254137f Mon Sep 17 00:00:00 2001 From: Jeremy Zimmerman Date: Thu, 11 May 2017 11:49:32 -0700 Subject: [PATCH] double if statement (#707) * Migrated `%` string formating * double if statement combined double 'if' to a single 'if' with 'and' * Revert "Fix "Prefer `format()` over string interpolation operator" issue" --- sanic/cookies.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sanic/cookies.py b/sanic/cookies.py index ce096cd2..16b798df 100644 --- a/sanic/cookies.py +++ b/sanic/cookies.py @@ -116,9 +116,8 @@ class Cookie(dict): )) except AttributeError: output.append('%s=%s' % (self._keys[key], value)) - elif key in self._flags: - if self[key]: - output.append(self._keys[key]) + elif key in self._flags and self[key]: + output.append(self._keys[key]) else: output.append('%s=%s' % (self._keys[key], value))