"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwebengine/src/3rdparty/chromium/third_party/jinja2/patches/0001-jinja2-make-compiled-template-deterministic-for-pyth.patch" (8 Jun 2022, 1159 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From: Takuto Ikuta <tikuta@chromium.org>
    2 Date: Mon, 24 May 2021 17:09:21 +0900
    3 Subject: [PATCH] jinja2: make compiled template deterministic for python3
    4 
    5 set() doesn't have deterministic iteration order, so need this to
    6 have deterministic output from jinja2.
    7 
    8 Bug: 1194274
    9 
   10 diff -Naur a/compiler.py b/compiler.py
   11 --- a/compiler.py   2021-10-05 23:41:45.774333282 +0900
   12 +++ b/compiler.py   2021-10-06 16:46:08.082078686 +0900
   13 @@ -468,7 +468,7 @@
   14              visitor.visit(node)
   15          for dependency in "filters", "tests":
   16              mapping = getattr(self, dependency)
   17 -            for name in getattr(visitor, dependency):
   18 +            for name in sorted(getattr(visitor, dependency)):
   19                  if name not in mapping:
   20                      mapping[name] = self.temporary_identifier()
   21                  self.writeline(
   22 @@ -612,7 +612,7 @@
   23      def dump_local_context(self, frame):
   24          return "{%s}" % ", ".join(
   25              "%r: %s" % (name, target)
   26 -            for name, target in iteritems(frame.symbols.dump_stores())
   27 +            for name, target in sorted(iteritems(frame.symbols.dump_stores()))
   28          )
   29  
   30      def write_commons(self):