Skip to content

Commit

Permalink
Fix SyntaxWarnings in Python 3.8 resulting from comparing literals wi…
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Jun 21, 2019
1 parent 983877e commit 3e36546
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changes
3.7 (unreleased)
----------------

...
- Fix SyntaxWarnings in Python 3.8 resulting from comparing literals with 'is'.
See https://github.com/plone/Products.CMFPlone/issues/2890.

3.6.1 (2019-04-01)
------------------
Expand Down
10 changes: 5 additions & 5 deletions src/chameleon/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def eval_token(token):
emit_bool = template(is_func=True,
func_args=('target', 's', 'default_marker', 'default'),
func_defaults=(None, None), source=r"""
if target is default_marker:
if target == default_marker:
target = default
elif target:
target = s
Expand All @@ -163,7 +163,7 @@ def eval_token(token):
source=r"""
if target is None:
pass
elif target is default_marker:
elif target == default_marker:
target = default
else:
__tt = type(target)
Expand Down Expand Up @@ -216,8 +216,8 @@ def func(target):
'default'),
func_defaults=(None,),
source=r"""
target = translate(msgid, default=default, domain=__i18n_domain,
context=__i18n_context,
target = translate(msgid, default=default, domain=__i18n_domain,
context=__i18n_context,
target_language=target_language)""")


Expand All @@ -230,7 +230,7 @@ def func(target, quote, quote_entity, default, default_marker):
if target is None:
return
if target is default_marker:
if target == default_marker:
return default
__tt = type(target)
Expand Down

0 comments on commit 3e36546

Please sign in to comment.