We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove pragma nocovers from Windows specific code
See #502 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cryptography/hazmat/bindings/openssl/binding.py`
Content:
```
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 #
5 #    http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10 # implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13 
14 from __future__ import absolute_import, division, print_function
15 
16 import os
17 import sys
18 import threading
19 
20 from cryptography.hazmat.bindings.utils import build_ffi_for_binding
21 
22 
23 _OSX_PRE_INCLUDE = """
24 #ifdef __APPLE__
25 #include <AvailabilityMacros.h>
26 #define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \
27     DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
28 #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
29 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
30 #endif
31 """
32 
33 _OSX_POST_INCLUDE = """
34 #ifdef __APPLE__
35 #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
36 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \
37     __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
38 #endif
39 """
40 
41 
42 class Binding(object):
43     """
44     OpenSSL API wrapper.
45     """
46     _module_prefix = "cryptography.hazmat.bindings.openssl."
47     _modules = [
48         "aes",
49         "asn1",
50         "bignum",
51         "bio",
52         "cmac",
53         "cms",
54         "conf",
55         "crypto",
56         "dh",
57         "dsa",
58         "ec",
59         "ecdh",
60         "ecdsa",
61         "engine",
62         "err",
63         "evp",
64         "hmac",
65         "nid",
66         "objects",
67         "opensslv",
68         "osrandom_engine",
69         "pem",
70         "pkcs7",
71         "pkcs12",
72         "rand",
73         "rsa",
74         "ssl",
75         "x509",
76         "x509name",
77         "x509v3",
78         "x509_vfy"
79     ]
80 
81     _locks = None
82     _lock_cb_handle = None
83     _lock_init_lock = threading.Lock()
84 
85     ffi = None
86     lib = None
87 
88     def __init__(self):
89         self._ensure_ffi_initialized()
90 
91     @classmethod
92     def _ensure_ffi_initialized(cls):
93         if cls.ffi is not None and cls.lib is not None:
94             return
95 
96         # OpenSSL goes by a different library name on different operating
97         # systems.
98         if sys.platform != "win32":
99             # In some circumstances, the order in which these libs are
100             # specified on the linker command-line is significant;
101             # libssl must come before libcrypto
102             # (http://marc.info/?l=openssl-users&m=135361825921871)
103             libraries = ["ssl", "crypto"]
104         else:  # pragma: no cover
105             link_type = os.environ.get("PYCA_WINDOWS_LINK_TYPE", "static")
106             libraries = _get_windows_libraries(link_type)
107 
108         cls.ffi, cls.lib = build_ffi_for_binding(
109             module_prefix=cls._module_prefix,
110             modules=cls._modules,
111             pre_include=_OSX_PRE_INCLUDE,
112             post_include=_OSX_POST_INCLUDE,
113             libraries=libraries,
114         )
115         res = cls.lib.Cryptography_add_osrandom_engine()
116         assert res != 0
117 
118     @classmethod
119     def init_static_locks(cls):
120         with cls._lock_init_lock:
121             cls._ensure_ffi_initialized()
122 
123             if not cls._lock_cb_handle:
124                 cls._lock_cb_handle = cls.ffi.callback(
125                     "void(int, int, const char *, int)",
126                     cls._lock_cb
127                 )
128 
129             # Use Python's implementation if available, importing _ssl triggers
130             # the setup for this.
131             __import__("_ssl")
132 
133             if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL:
134                 return
135 
136             # If nothing else has setup a locking callback already, we set up
137             # our own
138             num_locks = cls.lib.CRYPTO_num_locks()
139             cls._locks = [threading.Lock() for n in range(num_locks)]
140 
141             cls.lib.CRYPTO_set_locking_callback(cls._lock_cb_handle)
142 
143     @classmethod
144     def _lock_cb(cls, mode, n, file, line):
145         lock = cls._locks[n]
146 
147         if mode & cls.lib.CRYPTO_LOCK:
148             lock.acquire()
149         elif mode & cls.lib.CRYPTO_UNLOCK:
150             lock.release()
151         else:
152             raise RuntimeError(
153                 "Unknown lock mode {0}: lock={1}, file={2}, line={3}.".format(
154                     mode, n, file, line
155                 )
156             )
157 
158 
159 def _get_windows_libraries(link_type):
160     if link_type == "dynamic":
161         return ["libeay32", "ssleay32", "advapi32"]
162     elif link_type == "static" or link_type == "":
163         return ["libeay32mt", "ssleay32mt", "advapi32",
164                 "crypt32", "gdi32", "user32", "ws2_32"]
165     else:
166         raise ValueError(
167             "PYCA_WINDOWS_LINK_TYPE must be 'static' or 'dynamic'"
168         )
169
```
--- 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/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py
--- a/cryptography/hazmat/bindings/openssl/binding.py
+++ b/cryptography/hazmat/bindings/openssl/binding.py
@@ -95,15 +95,7 @@
 
         # OpenSSL goes by a different library name on different operating
         # systems.
-        if sys.platform != "win32":
-            # In some circumstances, the order in which these libs are
-            # specified on the linker command-line is significant;
-            # libssl must come before libcrypto
-            # (http://marc.info/?l=openssl-users&m=135361825921871)
-            libraries = ["ssl", "crypto"]
-        else:  # pragma: no cover
-            link_type = os.environ.get("PYCA_WINDOWS_LINK_TYPE", "static")
-            libraries = _get_windows_libraries(link_type)
+        libraries = _get_libraries(sys.platform)
 
         cls.ffi, cls.lib = build_ffi_for_binding(
             module_prefix=cls._module_prefix,
@@ -156,6 +148,18 @@
             )
 
 
+def _get_libraries(platform):
+    if platform != "win32":
+        # In some circumstances, the order in which these libs are
+        # specified on the linker command-line is significant;
+        # libssl must come before libcrypto
+        # (http://marc.info/?l=openssl-users&m=135361825921871)
+        return ["ssl", "crypto"]
+    else:
+        link_type = os.environ.get("PYCA_WINDOWS_LINK_TYPE", "static")
+        return _get_windows_libraries(link_type)
+
+
 def _get_windows_libraries(link_type):
     if link_type == "dynamic":
         return ["libeay32", "ssleay32", "advapi32"]

{"golden_diff": "diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py\n--- a/cryptography/hazmat/bindings/openssl/binding.py\n+++ b/cryptography/hazmat/bindings/openssl/binding.py\n@@ -95,15 +95,7 @@\n \n         # OpenSSL goes by a different library name on different operating\n         # systems.\n-        if sys.platform != \"win32\":\n-            # In some circumstances, the order in which these libs are\n-            # specified on the linker command-line is significant;\n-            # libssl must come before libcrypto\n-            # (http://marc.info/?l=openssl-users&m=135361825921871)\n-            libraries = [\"ssl\", \"crypto\"]\n-        else:  # pragma: no cover\n-            link_type = os.environ.get(\"PYCA_WINDOWS_LINK_TYPE\", \"static\")\n-            libraries = _get_windows_libraries(link_type)\n+        libraries = _get_libraries(sys.platform)\n \n         cls.ffi, cls.lib = build_ffi_for_binding(\n             module_prefix=cls._module_prefix,\n@@ -156,6 +148,18 @@\n             )\n \n \n+def _get_libraries(platform):\n+    if platform != \"win32\":\n+        # In some circumstances, the order in which these libs are\n+        # specified on the linker command-line is significant;\n+        # libssl must come before libcrypto\n+        # (http://marc.info/?l=openssl-users&m=135361825921871)\n+        return [\"ssl\", \"crypto\"]\n+    else:\n+        link_type = os.environ.get(\"PYCA_WINDOWS_LINK_TYPE\", \"static\")\n+        return _get_windows_libraries(link_type)\n+\n+\n def _get_windows_libraries(link_type):\n     if link_type == \"dynamic\":\n         return [\"libeay32\", \"ssleay32\", \"advapi32\"]\n", "issue": "Remove pragma nocovers from Windows specific code\nSee #502 \n\n", "before_files": [{"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n# implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport sys\nimport threading\n\nfrom cryptography.hazmat.bindings.utils import build_ffi_for_binding\n\n\n_OSX_PRE_INCLUDE = \"\"\"\n#ifdef __APPLE__\n#include <AvailabilityMacros.h>\n#define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n    DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#endif\n\"\"\"\n\n_OSX_POST_INCLUDE = \"\"\"\n#ifdef __APPLE__\n#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n    __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#endif\n\"\"\"\n\n\nclass Binding(object):\n    \"\"\"\n    OpenSSL API wrapper.\n    \"\"\"\n    _module_prefix = \"cryptography.hazmat.bindings.openssl.\"\n    _modules = [\n        \"aes\",\n        \"asn1\",\n        \"bignum\",\n        \"bio\",\n        \"cmac\",\n        \"cms\",\n        \"conf\",\n        \"crypto\",\n        \"dh\",\n        \"dsa\",\n        \"ec\",\n        \"ecdh\",\n        \"ecdsa\",\n        \"engine\",\n        \"err\",\n        \"evp\",\n        \"hmac\",\n        \"nid\",\n        \"objects\",\n        \"opensslv\",\n        \"osrandom_engine\",\n        \"pem\",\n        \"pkcs7\",\n        \"pkcs12\",\n        \"rand\",\n        \"rsa\",\n        \"ssl\",\n        \"x509\",\n        \"x509name\",\n        \"x509v3\",\n        \"x509_vfy\"\n    ]\n\n    _locks = None\n    _lock_cb_handle = None\n    _lock_init_lock = threading.Lock()\n\n    ffi = None\n    lib = None\n\n    def __init__(self):\n        self._ensure_ffi_initialized()\n\n    @classmethod\n    def _ensure_ffi_initialized(cls):\n        if cls.ffi is not None and cls.lib is not None:\n            return\n\n        # OpenSSL goes by a different library name on different operating\n        # systems.\n        if sys.platform != \"win32\":\n            # In some circumstances, the order in which these libs are\n            # specified on the linker command-line is significant;\n            # libssl must come before libcrypto\n            # (http://marc.info/?l=openssl-users&m=135361825921871)\n            libraries = [\"ssl\", \"crypto\"]\n        else:  # pragma: no cover\n            link_type = os.environ.get(\"PYCA_WINDOWS_LINK_TYPE\", \"static\")\n            libraries = _get_windows_libraries(link_type)\n\n        cls.ffi, cls.lib = build_ffi_for_binding(\n            module_prefix=cls._module_prefix,\n            modules=cls._modules,\n            pre_include=_OSX_PRE_INCLUDE,\n            post_include=_OSX_POST_INCLUDE,\n            libraries=libraries,\n        )\n        res = cls.lib.Cryptography_add_osrandom_engine()\n        assert res != 0\n\n    @classmethod\n    def init_static_locks(cls):\n        with cls._lock_init_lock:\n            cls._ensure_ffi_initialized()\n\n            if not cls._lock_cb_handle:\n                cls._lock_cb_handle = cls.ffi.callback(\n                    \"void(int, int, const char *, int)\",\n                    cls._lock_cb\n                )\n\n            # Use Python's implementation if available, importing _ssl triggers\n            # the setup for this.\n            __import__(\"_ssl\")\n\n            if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL:\n                return\n\n            # If nothing else has setup a locking callback already, we set up\n            # our own\n            num_locks = cls.lib.CRYPTO_num_locks()\n            cls._locks = [threading.Lock() for n in range(num_locks)]\n\n            cls.lib.CRYPTO_set_locking_callback(cls._lock_cb_handle)\n\n    @classmethod\n    def _lock_cb(cls, mode, n, file, line):\n        lock = cls._locks[n]\n\n        if mode & cls.lib.CRYPTO_LOCK:\n            lock.acquire()\n        elif mode & cls.lib.CRYPTO_UNLOCK:\n            lock.release()\n        else:\n            raise RuntimeError(\n                \"Unknown lock mode {0}: lock={1}, file={2}, line={3}.\".format(\n                    mode, n, file, line\n                )\n            )\n\n\ndef _get_windows_libraries(link_type):\n    if link_type == \"dynamic\":\n        return [\"libeay32\", \"ssleay32\", \"advapi32\"]\n    elif link_type == \"static\" or link_type == \"\":\n        return [\"libeay32mt\", \"ssleay32mt\", \"advapi32\",\n                \"crypt32\", \"gdi32\", \"user32\", \"ws2_32\"]\n    else:\n        raise ValueError(\n            \"PYCA_WINDOWS_LINK_TYPE must be 'static' or 'dynamic'\"\n        )\n", "path": "cryptography/hazmat/bindings/openssl/binding.py"}], "after_files": [{"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n# implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport sys\nimport threading\n\nfrom cryptography.hazmat.bindings.utils import build_ffi_for_binding\n\n\n_OSX_PRE_INCLUDE = \"\"\"\n#ifdef __APPLE__\n#include <AvailabilityMacros.h>\n#define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n    DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#endif\n\"\"\"\n\n_OSX_POST_INCLUDE = \"\"\"\n#ifdef __APPLE__\n#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n    __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n#endif\n\"\"\"\n\n\nclass Binding(object):\n    \"\"\"\n    OpenSSL API wrapper.\n    \"\"\"\n    _module_prefix = \"cryptography.hazmat.bindings.openssl.\"\n    _modules = [\n        \"aes\",\n        \"asn1\",\n        \"bignum\",\n        \"bio\",\n        \"cmac\",\n        \"cms\",\n        \"conf\",\n        \"crypto\",\n        \"dh\",\n        \"dsa\",\n        \"ec\",\n        \"ecdh\",\n        \"ecdsa\",\n        \"engine\",\n        \"err\",\n        \"evp\",\n        \"hmac\",\n        \"nid\",\n        \"objects\",\n        \"opensslv\",\n        \"osrandom_engine\",\n        \"pem\",\n        \"pkcs7\",\n        \"pkcs12\",\n        \"rand\",\n        \"rsa\",\n        \"ssl\",\n        \"x509\",\n        \"x509name\",\n        \"x509v3\",\n        \"x509_vfy\"\n    ]\n\n    _locks = None\n    _lock_cb_handle = None\n    _lock_init_lock = threading.Lock()\n\n    ffi = None\n    lib = None\n\n    def __init__(self):\n        self._ensure_ffi_initialized()\n\n    @classmethod\n    def _ensure_ffi_initialized(cls):\n        if cls.ffi is not None and cls.lib is not None:\n            return\n\n        # OpenSSL goes by a different library name on different operating\n        # systems.\n        libraries = _get_libraries(sys.platform)\n\n        cls.ffi, cls.lib = build_ffi_for_binding(\n            module_prefix=cls._module_prefix,\n            modules=cls._modules,\n            pre_include=_OSX_PRE_INCLUDE,\n            post_include=_OSX_POST_INCLUDE,\n            libraries=libraries,\n        )\n        res = cls.lib.Cryptography_add_osrandom_engine()\n        assert res != 0\n\n    @classmethod\n    def init_static_locks(cls):\n        with cls._lock_init_lock:\n            cls._ensure_ffi_initialized()\n\n            if not cls._lock_cb_handle:\n                cls._lock_cb_handle = cls.ffi.callback(\n                    \"void(int, int, const char *, int)\",\n                    cls._lock_cb\n                )\n\n            # Use Python's implementation if available, importing _ssl triggers\n            # the setup for this.\n            __import__(\"_ssl\")\n\n            if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL:\n                return\n\n            # If nothing else has setup a locking callback already, we set up\n            # our own\n            num_locks = cls.lib.CRYPTO_num_locks()\n            cls._locks = [threading.Lock() for n in range(num_locks)]\n\n            cls.lib.CRYPTO_set_locking_callback(cls._lock_cb_handle)\n\n    @classmethod\n    def _lock_cb(cls, mode, n, file, line):\n        lock = cls._locks[n]\n\n        if mode & cls.lib.CRYPTO_LOCK:\n            lock.acquire()\n        elif mode & cls.lib.CRYPTO_UNLOCK:\n            lock.release()\n        else:\n            raise RuntimeError(\n                \"Unknown lock mode {0}: lock={1}, file={2}, line={3}.\".format(\n                    mode, n, file, line\n                )\n            )\n\n\ndef _get_libraries(platform):\n    if platform != \"win32\":\n        # In some circumstances, the order in which these libs are\n        # specified on the linker command-line is significant;\n        # libssl must come before libcrypto\n        # (http://marc.info/?l=openssl-users&m=135361825921871)\n        return [\"ssl\", \"crypto\"]\n    else:\n        link_type = os.environ.get(\"PYCA_WINDOWS_LINK_TYPE\", \"static\")\n        return _get_windows_libraries(link_type)\n\n\ndef _get_windows_libraries(link_type):\n    if link_type == \"dynamic\":\n        return [\"libeay32\", \"ssleay32\", \"advapi32\"]\n    elif link_type == \"static\" or link_type == \"\":\n        return [\"libeay32mt\", \"ssleay32mt\", \"advapi32\",\n                \"crypt32\", \"gdi32\", \"user32\", \"ws2_32\"]\n    else:\n        raise ValueError(\n            \"PYCA_WINDOWS_LINK_TYPE must be 'static' or 'dynamic'\"\n        )\n", "path": "cryptography/hazmat/bindings/openssl/binding.py"}]}