We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Upstream change in django-treebeard 4.5 requires a new wagtail core migration
Default MP_Node depth has changed to 1.

https://github.com/django-treebeard/django-treebeard/commit/454be8f29ac2b4b4fbe6512357b5afc1eb422bab#diff-35501ef525349cd39e4713d1a9f64a249fa4fbd31d875513e3a15e65988701a2

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 from wagtail import __version__
4 from wagtail.utils.setup import assets, check_bdist_egg, sdist
5 
6 
7 try:
8     from setuptools import find_packages, setup
9 except ImportError:
10     from distutils.core import setup
11 
12 
13 # Hack to prevent "TypeError: 'NoneType' object is not callable" error
14 # in multiprocessing/util.py _exit_function when setup.py exits
15 # (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
16 try:
17     import multiprocessing  # noqa
18 except ImportError:
19     pass
20 
21 
22 install_requires = [
23     "Django>=2.2,<3.2",
24     "django-modelcluster>=5.1,<6.0",
25     "django-taggit>=1.0,<2.0",
26     "django-treebeard>=4.2.0,<4.5",
27     "djangorestframework>=3.11.1,<4.0",
28     "django-filter>=2.2,<3.0",
29     "draftjs_exporter>=2.1.5,<3.0",
30     "Pillow>=4.0.0,<9.0.0",
31     "beautifulsoup4>=4.8,<4.9",
32     "html5lib>=0.999,<2",
33     "Willow>=1.4,<1.5",
34     "requests>=2.11.1,<3.0",
35     "l18n>=2018.5",
36     "xlsxwriter>=1.2.8,<2.0",
37     "tablib[xls,xlsx]>=0.14.0",
38     "anyascii>=0.1.5",
39 ]
40 
41 # Testing dependencies
42 testing_extras = [
43     # Required for running the tests
44     'python-dateutil>=2.2',
45     'pytz>=2014.7',
46     'elasticsearch>=5.0,<6.0',
47     'Jinja2>=2.11,<3.0',
48     'boto3>=1.16,<1.17',
49     'freezegun>=0.3.8',
50     'openpyxl>=2.6.4',
51     'Unidecode>=0.04.14,<2.0',
52 
53     # For coverage and PEP8 linting
54     'coverage>=3.7.0',
55     'flake8>=3.6.0',
56     'isort==5.6.4',  # leave this pinned - it tends to change rules between patch releases
57     'flake8-blind-except==0.1.1',
58     'flake8-print==2.0.2',
59     'doc8==0.8.1',
60 
61     # For templates linting
62     'jinjalint>=0.5',
63 
64     # Pipenv hack to fix broken dependency causing CircleCI failures
65     'docutils==0.15',
66 
67     # django-taggit 1.3.0 made changes to verbose_name which affect migrations;
68     # the test suite migrations correspond to >=1.3.0
69     'django-taggit>=1.3.0,<2.0',
70 ]
71 
72 # Documentation dependencies
73 documentation_extras = [
74     'pyenchant>=3.1.1,<4',
75     'sphinxcontrib-spelling>=5.4.0,<6',
76     'Sphinx>=1.5.2',
77     'sphinx-autobuild>=0.6.0',
78     'sphinx_rtd_theme>=0.1.9',
79     'recommonmark>=0.7.1',
80 ]
81 
82 setup(
83     name='wagtail',
84     version=__version__,
85     description='A Django content management system.',
86     author='Wagtail core team + contributors',
87     author_email='hello@wagtail.io',  # For support queries, please see https://docs.wagtail.io/en/stable/support.html
88     url='https://wagtail.io/',
89     packages=find_packages(),
90     include_package_data=True,
91     license='BSD',
92     long_description="Wagtail is an open source content management \
93 system built on Django, with a strong community and commercial support. \
94 It’s focused on user experience, and offers precise control for \
95 designers and developers.\n\n\
96 For more details, see https://wagtail.io, https://docs.wagtail.io and \
97 https://github.com/wagtail/wagtail/.",
98     classifiers=[
99         'Development Status :: 5 - Production/Stable',
100         'Environment :: Web Environment',
101         'Intended Audience :: Developers',
102         'License :: OSI Approved :: BSD License',
103         'Operating System :: OS Independent',
104         'Programming Language :: Python',
105         'Programming Language :: Python :: 3',
106         'Programming Language :: Python :: 3.6',
107         'Programming Language :: Python :: 3.7',
108         'Programming Language :: Python :: 3.8',
109         'Programming Language :: Python :: 3.9',
110         'Framework :: Django',
111         'Framework :: Django :: 2.2',
112         'Framework :: Django :: 3.0',
113         'Framework :: Django :: 3.1',
114         'Framework :: Wagtail',
115         'Topic :: Internet :: WWW/HTTP :: Site Management',
116     ],
117     python_requires='>=3.6',
118     install_requires=install_requires,
119     extras_require={
120         'testing': testing_extras,
121         'docs': documentation_extras
122     },
123     entry_points="""
124             [console_scripts]
125             wagtail=wagtail.bin.wagtail:main
126     """,
127     zip_safe=False,
128     cmdclass={
129         'sdist': sdist,
130         'bdist_egg': check_bdist_egg,
131         'assets': assets,
132     },
133 )
134
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@
     "Django>=2.2,<3.2",
     "django-modelcluster>=5.1,<6.0",
     "django-taggit>=1.0,<2.0",
-    "django-treebeard>=4.2.0,<4.5",
+    "django-treebeard>=4.2.0,<5.0,!=4.5",
     "djangorestframework>=3.11.1,<4.0",
     "django-filter>=2.2,<3.0",
     "draftjs_exporter>=2.1.5,<3.0",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -23,7 +23,7 @@\n     \"Django>=2.2,<3.2\",\n     \"django-modelcluster>=5.1,<6.0\",\n     \"django-taggit>=1.0,<2.0\",\n-    \"django-treebeard>=4.2.0,<4.5\",\n+    \"django-treebeard>=4.2.0,<5.0,!=4.5\",\n     \"djangorestframework>=3.11.1,<4.0\",\n     \"django-filter>=2.2,<3.0\",\n     \"draftjs_exporter>=2.1.5,<3.0\",\n", "issue": "Upstream change in django-treebeard 4.5 requires a new wagtail core migration\nDefault MP_Node depth has changed to 1.\r\n\r\nhttps://github.com/django-treebeard/django-treebeard/commit/454be8f29ac2b4b4fbe6512357b5afc1eb422bab#diff-35501ef525349cd39e4713d1a9f64a249fa4fbd31d875513e3a15e65988701a2\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom wagtail import __version__\nfrom wagtail.utils.setup import assets, check_bdist_egg, sdist\n\n\ntry:\n    from setuptools import find_packages, setup\nexcept ImportError:\n    from distutils.core import setup\n\n\n# Hack to prevent \"TypeError: 'NoneType' object is not callable\" error\n# in multiprocessing/util.py _exit_function when setup.py exits\n# (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)\ntry:\n    import multiprocessing  # noqa\nexcept ImportError:\n    pass\n\n\ninstall_requires = [\n    \"Django>=2.2,<3.2\",\n    \"django-modelcluster>=5.1,<6.0\",\n    \"django-taggit>=1.0,<2.0\",\n    \"django-treebeard>=4.2.0,<4.5\",\n    \"djangorestframework>=3.11.1,<4.0\",\n    \"django-filter>=2.2,<3.0\",\n    \"draftjs_exporter>=2.1.5,<3.0\",\n    \"Pillow>=4.0.0,<9.0.0\",\n    \"beautifulsoup4>=4.8,<4.9\",\n    \"html5lib>=0.999,<2\",\n    \"Willow>=1.4,<1.5\",\n    \"requests>=2.11.1,<3.0\",\n    \"l18n>=2018.5\",\n    \"xlsxwriter>=1.2.8,<2.0\",\n    \"tablib[xls,xlsx]>=0.14.0\",\n    \"anyascii>=0.1.5\",\n]\n\n# Testing dependencies\ntesting_extras = [\n    # Required for running the tests\n    'python-dateutil>=2.2',\n    'pytz>=2014.7',\n    'elasticsearch>=5.0,<6.0',\n    'Jinja2>=2.11,<3.0',\n    'boto3>=1.16,<1.17',\n    'freezegun>=0.3.8',\n    'openpyxl>=2.6.4',\n    'Unidecode>=0.04.14,<2.0',\n\n    # For coverage and PEP8 linting\n    'coverage>=3.7.0',\n    'flake8>=3.6.0',\n    'isort==5.6.4',  # leave this pinned - it tends to change rules between patch releases\n    'flake8-blind-except==0.1.1',\n    'flake8-print==2.0.2',\n    'doc8==0.8.1',\n\n    # For templates linting\n    'jinjalint>=0.5',\n\n    # Pipenv hack to fix broken dependency causing CircleCI failures\n    'docutils==0.15',\n\n    # django-taggit 1.3.0 made changes to verbose_name which affect migrations;\n    # the test suite migrations correspond to >=1.3.0\n    'django-taggit>=1.3.0,<2.0',\n]\n\n# Documentation dependencies\ndocumentation_extras = [\n    'pyenchant>=3.1.1,<4',\n    'sphinxcontrib-spelling>=5.4.0,<6',\n    'Sphinx>=1.5.2',\n    'sphinx-autobuild>=0.6.0',\n    'sphinx_rtd_theme>=0.1.9',\n    'recommonmark>=0.7.1',\n]\n\nsetup(\n    name='wagtail',\n    version=__version__,\n    description='A Django content management system.',\n    author='Wagtail core team + contributors',\n    author_email='hello@wagtail.io',  # For support queries, please see https://docs.wagtail.io/en/stable/support.html\n    url='https://wagtail.io/',\n    packages=find_packages(),\n    include_package_data=True,\n    license='BSD',\n    long_description=\"Wagtail is an open source content management \\\nsystem built on Django, with a strong community and commercial support. \\\nIt\u2019s focused on user experience, and offers precise control for \\\ndesigners and developers.\\n\\n\\\nFor more details, see https://wagtail.io, https://docs.wagtail.io and \\\nhttps://github.com/wagtail/wagtail/.\",\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Web Environment',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Framework :: Django',\n        'Framework :: Django :: 2.2',\n        'Framework :: Django :: 3.0',\n        'Framework :: Django :: 3.1',\n        'Framework :: Wagtail',\n        'Topic :: Internet :: WWW/HTTP :: Site Management',\n    ],\n    python_requires='>=3.6',\n    install_requires=install_requires,\n    extras_require={\n        'testing': testing_extras,\n        'docs': documentation_extras\n    },\n    entry_points=\"\"\"\n            [console_scripts]\n            wagtail=wagtail.bin.wagtail:main\n    \"\"\",\n    zip_safe=False,\n    cmdclass={\n        'sdist': sdist,\n        'bdist_egg': check_bdist_egg,\n        'assets': assets,\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nfrom wagtail import __version__\nfrom wagtail.utils.setup import assets, check_bdist_egg, sdist\n\n\ntry:\n    from setuptools import find_packages, setup\nexcept ImportError:\n    from distutils.core import setup\n\n\n# Hack to prevent \"TypeError: 'NoneType' object is not callable\" error\n# in multiprocessing/util.py _exit_function when setup.py exits\n# (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)\ntry:\n    import multiprocessing  # noqa\nexcept ImportError:\n    pass\n\n\ninstall_requires = [\n    \"Django>=2.2,<3.2\",\n    \"django-modelcluster>=5.1,<6.0\",\n    \"django-taggit>=1.0,<2.0\",\n    \"django-treebeard>=4.2.0,<5.0,!=4.5\",\n    \"djangorestframework>=3.11.1,<4.0\",\n    \"django-filter>=2.2,<3.0\",\n    \"draftjs_exporter>=2.1.5,<3.0\",\n    \"Pillow>=4.0.0,<9.0.0\",\n    \"beautifulsoup4>=4.8,<4.9\",\n    \"html5lib>=0.999,<2\",\n    \"Willow>=1.4,<1.5\",\n    \"requests>=2.11.1,<3.0\",\n    \"l18n>=2018.5\",\n    \"xlsxwriter>=1.2.8,<2.0\",\n    \"tablib[xls,xlsx]>=0.14.0\",\n    \"anyascii>=0.1.5\",\n]\n\n# Testing dependencies\ntesting_extras = [\n    # Required for running the tests\n    'python-dateutil>=2.2',\n    'pytz>=2014.7',\n    'elasticsearch>=5.0,<6.0',\n    'Jinja2>=2.11,<3.0',\n    'boto3>=1.16,<1.17',\n    'freezegun>=0.3.8',\n    'openpyxl>=2.6.4',\n    'Unidecode>=0.04.14,<2.0',\n\n    # For coverage and PEP8 linting\n    'coverage>=3.7.0',\n    'flake8>=3.6.0',\n    'isort==5.6.4',  # leave this pinned - it tends to change rules between patch releases\n    'flake8-blind-except==0.1.1',\n    'flake8-print==2.0.2',\n    'doc8==0.8.1',\n\n    # For templates linting\n    'jinjalint>=0.5',\n\n    # Pipenv hack to fix broken dependency causing CircleCI failures\n    'docutils==0.15',\n\n    # django-taggit 1.3.0 made changes to verbose_name which affect migrations;\n    # the test suite migrations correspond to >=1.3.0\n    'django-taggit>=1.3.0,<2.0',\n]\n\n# Documentation dependencies\ndocumentation_extras = [\n    'pyenchant>=3.1.1,<4',\n    'sphinxcontrib-spelling>=5.4.0,<6',\n    'Sphinx>=1.5.2',\n    'sphinx-autobuild>=0.6.0',\n    'sphinx_rtd_theme>=0.1.9',\n    'recommonmark>=0.7.1',\n]\n\nsetup(\n    name='wagtail',\n    version=__version__,\n    description='A Django content management system.',\n    author='Wagtail core team + contributors',\n    author_email='hello@wagtail.io',  # For support queries, please see https://docs.wagtail.io/en/stable/support.html\n    url='https://wagtail.io/',\n    packages=find_packages(),\n    include_package_data=True,\n    license='BSD',\n    long_description=\"Wagtail is an open source content management \\\nsystem built on Django, with a strong community and commercial support. \\\nIt\u2019s focused on user experience, and offers precise control for \\\ndesigners and developers.\\n\\n\\\nFor more details, see https://wagtail.io, https://docs.wagtail.io and \\\nhttps://github.com/wagtail/wagtail/.\",\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Web Environment',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Framework :: Django',\n        'Framework :: Django :: 2.2',\n        'Framework :: Django :: 3.0',\n        'Framework :: Django :: 3.1',\n        'Framework :: Wagtail',\n        'Topic :: Internet :: WWW/HTTP :: Site Management',\n    ],\n    python_requires='>=3.6',\n    install_requires=install_requires,\n    extras_require={\n        'testing': testing_extras,\n        'docs': documentation_extras\n    },\n    entry_points=\"\"\"\n            [console_scripts]\n            wagtail=wagtail.bin.wagtail:main\n    \"\"\",\n    zip_safe=False,\n    cmdclass={\n        'sdist': sdist,\n        'bdist_egg': check_bdist_egg,\n        'assets': assets,\n    },\n)\n", "path": "setup.py"}]}