use Constant.value

This commit is contained in:
jlwwlsqc 2020-07-08 15:53:03 +08:00
parent 526b75cea5
commit 7c4b283246
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 724eab2bcdf020a9dd3893b372730dd19c82f036 Mon Sep 17 00:00:00 2001
From: fwx937284 <fyq%403195354>
Date: Wed, 8 Jul 2020 15:24:47 +0800
Subject: [PATCH] Use Constant.value, not Constant.n
---
mako/_ast_util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mako/_ast_util.py b/mako/_ast_util.py
index d770451..3120659 100644
--- a/mako/_ast_util.py
+++ b/mako/_ast_util.py
@@ -681,7 +681,7 @@ class SourceGenerator(NodeVisitor):
self.write(repr(node.n))
# newly needed in Python 3.8
def visit_Constant(self, node):
- self.write(repr(node.n))
+ self.write(repr(node.value))
def visit_Tuple(self, node):
self.write('(')
--
2.23.0

View File

@ -1,6 +1,6 @@
Name: python-mako
Version: 1.0.6
Release: 13
Release: 14
Summary: Mako template library for Python
License: (MIT and Python) and (BSD or GPLv2)
Group: Development/Languages
@ -9,6 +9,7 @@ Source0: https://bitbucket.org/zzzeek/mako/get/rel_%(echo %{version} | sed "s/\.
BuildArch: noarch
Patch6000: backport-optimize-make-test.patch
Patch6001: backport-use-Constant-value.patch
BuildRequires: python2-devel python2-pytest python2-setuptools
BuildRequires: python2-markupsafe python2-nose python2-mock
@ -84,6 +85,12 @@ rm -rf doc/build
%doc doc
%changelog
* Wed Jul 8 2020 xinghe<xinghe1@huawei.com> - 1.0.6-14
- Type:bufix
- ID:NA
- SUG:NA
- DESC:Use Constant.value
* Wed Jun 24 2020 wenzhanli<wenzhanli2m@huawei.com> - 1.0.6-13
- Type:bugfix
- ID:NA