-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmailman3-RemoveContextManagerUsageForPosixPath-391816a2.patch
More file actions
53 lines (51 loc) · 2.75 KB
/
mailman3-RemoveContextManagerUsageForPosixPath-391816a2.patch
File metadata and controls
53 lines (51 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff --git a/src/mailman/utilities/i18n.py b/src/mailman/utilities/i18n.py
index a694ae8dd..d4ab9085b 100644
--- a/src/mailman/utilities/i18n.py
+++ b/src/mailman/utilities/i18n.py
@@ -114,8 +114,7 @@ def search(resources, template_file, mlist=None, language=None):
languages.append(language)
languages.reverse()
# The non-language qualified $template_dir paths in search order.
- templates_dir = str(resources.enter_context(
- files('mailman').joinpath('templates')))
+ templates_dir = str(files('mailman').joinpath('templates'))
paths = [templates_dir, os.path.join(config.TEMPLATE_DIR, 'site')]
if mlist is not None:
# Don't forget these are in REVERSE search order!
diff --git a/src/mailman/utilities/tests/test_modules.py b/src/mailman/utilities/tests/test_modules.py
index baa39417b..f52553092 100644
--- a/src/mailman/utilities/tests/test_modules.py
+++ b/src/mailman/utilities/tests/test_modules.py
@@ -164,8 +164,7 @@ class AbstractStyle:
def test_find_pluggable_components_by_plugin_name(self):
with ExitStack() as resources:
- testing_path = resources.enter_context(
- files('mailman.plugins.testing'))
+ testing_path = files('mailman.plugins.testing')
resources.enter_context(hack_syspath(0, str(testing_path)))
resources.enter_context(configuration('plugin.example', **{
'class': 'example.hooks.ExamplePlugin',
@@ -176,8 +175,7 @@ class AbstractStyle:
def test_find_pluggable_components_by_component_package(self):
with ExitStack() as resources:
- testing_path = resources.enter_context(
- files('mailman.plugins.testing'))
+ testing_path = files('mailman.plugins.testing')
resources.enter_context(hack_syspath(0, str(testing_path)))
resources.enter_context(configuration('plugin.example', **{
'class': 'example.hooks.ExamplePlugin',
diff --git a/src/mailman/utilities/tests/test_templates.py b/src/mailman/utilities/tests/test_templates.py
index 43c680b23..e5a6139f7 100644
--- a/src/mailman/utilities/tests/test_templates.py
+++ b/src/mailman/utilities/tests/test_templates.py
@@ -63,8 +63,8 @@ class TestSearchOrder(unittest.TestCase):
# tree. The former will use /v/ as the root and the latter will use
# /m/ as the root.
with ExitStack() as resources:
- in_tree = str(resources.enter_context(
- resource_path('mailman').joinpath('templates')).parent)
+ in_tree = str(
+ resource_path('mailman').joinpath('templates').parent)
raw_search_order = search(
resources, template_file, mailing_list, language)
for path in raw_search_order: