From 48df932ae4473df9ad20e795217af466f28a6bea Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 7 Feb 2019 15:59:05 +0100 Subject: [PATCH] refactoring --- dotdrop/templategen.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dotdrop/templategen.py b/dotdrop/templategen.py index 62812cf..625617c 100644 --- a/dotdrop/templategen.py +++ b/dotdrop/templategen.py @@ -87,11 +87,8 @@ class Templategen: content = template.render() except UnicodeDecodeError: data = self._read_bad_encoded_text(src) - template = self.env.from_string(data) - content = template.render() - - content = content.encode('UTF-8') - return content + content = self.generate_string(data) + return content.encode('utf-8') def _handle_bin_file(self, src): """write binary to file"""