We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Improve our warnings in line with PEP 565
See astropy/astropy#8465

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sunpy/util/exceptions.py`
Content:
```
1 # Licensed under a 3-clause BSD style license - see LICENSE.rst
2 """
3 This module contains errors/exceptions and warnings of general use for
4 sunpy. Exceptions that are specific to a given subpackage should *not*
5 be here, but rather in the particular subpackage.
6 """
7 
8 class SunpyWarning(Warning):
9     """
10     The base warning class from which all Sunpy warnings should inherit.
11     """
12 
13 
14 class SunpyUserWarning(UserWarning, SunpyWarning):
15     """
16     The primary warning class for Sunpy.
17 
18     Use this if you do not need a specific sub-class.
19     """
20 
21 
22 class SunpyDeprecationWarning(SunpyWarning):
23     """
24     A warning class to indicate a deprecated feature.
25     """
26
```
--- 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/sunpy/util/exceptions.py b/sunpy/util/exceptions.py
--- a/sunpy/util/exceptions.py
+++ b/sunpy/util/exceptions.py
@@ -4,6 +4,8 @@
 sunpy. Exceptions that are specific to a given subpackage should *not*
 be here, but rather in the particular subpackage.
 """
+import sys
+
 
 class SunpyWarning(Warning):
     """
@@ -19,7 +21,11 @@
     """
 
 
-class SunpyDeprecationWarning(SunpyWarning):
+# For PEP 565 (https://www.python.org/dev/peps/pep-0565/) compliance.
+DeprecationClass = DeprecationWarning if sys.version_info >= (3, 7) else FutureWarning
+
+
+class SunpyDeprecationWarning(DeprecationClass, SunpyWarning):
     """
     A warning class to indicate a deprecated feature.
     """

{"golden_diff": "diff --git a/sunpy/util/exceptions.py b/sunpy/util/exceptions.py\n--- a/sunpy/util/exceptions.py\n+++ b/sunpy/util/exceptions.py\n@@ -4,6 +4,8 @@\n sunpy. Exceptions that are specific to a given subpackage should *not*\n be here, but rather in the particular subpackage.\n \"\"\"\n+import sys\n+\n \n class SunpyWarning(Warning):\n     \"\"\"\n@@ -19,7 +21,11 @@\n     \"\"\"\n \n \n-class SunpyDeprecationWarning(SunpyWarning):\n+# For PEP 565 (https://www.python.org/dev/peps/pep-0565/) compliance.\n+DeprecationClass = DeprecationWarning if sys.version_info >= (3, 7) else FutureWarning\n+\n+\n+class SunpyDeprecationWarning(DeprecationClass, SunpyWarning):\n     \"\"\"\n     A warning class to indicate a deprecated feature.\n     \"\"\"\n", "issue": "Improve our warnings in line with PEP 565\nSee astropy/astropy#8465\n", "before_files": [{"content": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nThis module contains errors/exceptions and warnings of general use for\nsunpy. Exceptions that are specific to a given subpackage should *not*\nbe here, but rather in the particular subpackage.\n\"\"\"\n\nclass SunpyWarning(Warning):\n    \"\"\"\n    The base warning class from which all Sunpy warnings should inherit.\n    \"\"\"\n\n\nclass SunpyUserWarning(UserWarning, SunpyWarning):\n    \"\"\"\n    The primary warning class for Sunpy.\n\n    Use this if you do not need a specific sub-class.\n    \"\"\"\n\n\nclass SunpyDeprecationWarning(SunpyWarning):\n    \"\"\"\n    A warning class to indicate a deprecated feature.\n    \"\"\"\n", "path": "sunpy/util/exceptions.py"}], "after_files": [{"content": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nThis module contains errors/exceptions and warnings of general use for\nsunpy. Exceptions that are specific to a given subpackage should *not*\nbe here, but rather in the particular subpackage.\n\"\"\"\nimport sys\n\n\nclass SunpyWarning(Warning):\n    \"\"\"\n    The base warning class from which all Sunpy warnings should inherit.\n    \"\"\"\n\n\nclass SunpyUserWarning(UserWarning, SunpyWarning):\n    \"\"\"\n    The primary warning class for Sunpy.\n\n    Use this if you do not need a specific sub-class.\n    \"\"\"\n\n\n# For PEP 565 (https://www.python.org/dev/peps/pep-0565/) compliance.\nDeprecationClass = DeprecationWarning if sys.version_info >= (3, 7) else FutureWarning\n\n\nclass SunpyDeprecationWarning(DeprecationClass, SunpyWarning):\n    \"\"\"\n    A warning class to indicate a deprecated feature.\n    \"\"\"\n", "path": "sunpy/util/exceptions.py"}]}