From: Vladimír Vondruš Date: Sun, 15 Sep 2024 20:59:38 +0000 (+0200) Subject: css: fix more Python 3.12 unknown escape warnings. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=f4fcf1ad9a74629c65ea5bdd49d797469a19152d;p=blog.git css: fix more Python 3.12 unknown escape warnings. --- diff --git a/css/postprocess.py b/css/postprocess.py index 321d7f58..a36a290d 100755 --- a/css/postprocess.py +++ b/css/postprocess.py @@ -33,7 +33,7 @@ import os import sys import_rx = re.compile("^@import url\\('(?P[^']+)'\\);$") -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*$") diff --git a/plugins/m/test/test_math.py b/plugins/m/test/test_math.py index 957635a6..4a7c447a 100644 --- a/plugins/m/test/test_math.py +++ b/plugins/m/test/test_math.py @@ -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 = """ @@ -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)