chiark / gitweb /
css: fix more Python 3.12 unknown escape warnings.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 15 Sep 2024 20:59:38 +0000 (22:59 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 15 Sep 2024 22:04:47 +0000 (00:04 +0200)
css/postprocess.py
plugins/m/test/test_math.py

index 321d7f58180e44576853093097035a325f632517..a36a290d90d9f7c22b3bce046af52cd9002cabf4 100755 (executable)
@@ -33,7 +33,7 @@ import os
 import sys
 
 import_rx = re.compile("^@import url\\('(?P<file>[^']+)'\\);$")
-opening_brace_rx = re.compile("^\\s*:root\s*{\\s*$")
+opening_brace_rx = re.compile("^\\s*:root\\s*{\\s*$")
 closing_brace_rx = re.compile("^\\s*}\\s*$")
 comment_rx = re.compile("^\\s*(/\\*.*\\*/)?\\s*$")
 comment_start_rx = re.compile("^\\s*(/\\*.*)\\s*$")
index 957635a694199b6bdc6565f2bda7528ebf69a3ef..4a7c447aeaa8e37aa8f8f0455b45b78c552137d0 100644 (file)
@@ -61,7 +61,7 @@ class Math(PelicanPluginTestCase):
         self.assertFalse(os.path.exists(os.path.join(self.path, 'm.math.cache')))
 
 # Actually generated from $\frac{\tau}{2}$ tho
-tau_half_hash = sha1("""$\pi$""".encode('utf-8')).digest()
+tau_half_hash = sha1("""$\\pi$""".encode('utf-8')).digest()
 tau_half = """<?xml version='1.0' encoding='UTF-8'?>
 <!-- This file was generated by dvisvgm 2.6.3 -->
 <svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='5.847936pt' height='15.326665pt' viewBox='1.195514 -8.1387 4.678349 12.261332'>
@@ -157,7 +157,7 @@ class Uncached(PelicanPluginTestCase):
         # The file is the same expect for titles of the formulas. Replace them
         # and then compare.
         with open(os.path.join(self.path, 'output', 'page.html')) as f:
-            actual_contents = f.read().strip().replace('a^3 + b^3 \\neq c^3', 'a^2 + b^2 = c^2').replace('\\frac{\\tau}{2}', '\pi')
+            actual_contents = f.read().strip().replace('a^3 + b^3 \\neq c^3', 'a^2 + b^2 = c^2').replace('\\frac{\\tau}{2}', '\\pi')
 
         self.assertEqual(actual_contents, expected_contents)