We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Uproot fails with self-built XRootD
With Uproot 4.0.11 and a self-built XRootD with Python bindings, `import uproot` fails with `TypeError: '<' not supported between instances of 'str' and 'int'`. This is due to the following line: https://github.com/scikit-hep/uproot4/blob/d6f9bea0f1a9ca6806445b95da93efa37c5117ba/src/uproot/extras.py#L116

When one builds XRootD, the version number differs from the standard `x.y.z` - it is, e.g., `v20210712-58b374f12`, which causes `LooseVersion` to raise `TypeError`. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/uproot/extras.py`
Content:
```
1 # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
2 
3 """
4 This module defines functions that import external libraries used by Uproot, but not
5 required by an Uproot installation. (Uproot only requires NumPy).
6 
7 If a library cannot be imported, these functions raise ``ImportError`` with
8 error messages containing instructions on how to install the library.
9 """
10 
11 from __future__ import absolute_import
12 
13 import atexit
14 import os
15 from distutils.version import LooseVersion
16 
17 import pkg_resources
18 
19 
20 def awkward():
21     """
22     Imports and returns ``awkward``.
23     """
24     try:
25         import awkward
26     except ImportError:
27         raise ImportError(
28             """install the 'awkward' package with:
29 
30     pip install awkward
31 
32 Alternatively, you can use ``library="np"`` or globally set ``uproot.default_library``
33 to output as NumPy arrays, rather than Awkward arrays.
34 """
35         )
36     else:
37         return awkward
38 
39 
40 def pandas():
41     """
42     Imports and returns ``pandas``.
43     """
44     try:
45         import pandas
46     except ImportError:
47         raise ImportError(
48             """install the 'pandas' package with:
49 
50     pip install pandas
51 
52 or
53 
54     conda install pandas"""
55         )
56     else:
57         return pandas
58 
59 
60 def XRootD_client():
61     """
62     Imports and returns ``XRootD.client`` (after setting the
63     ```XRD_RUNFORKHANDLER`` environment variable to ``"1"``, to allow
64     multiprocessing).
65     """
66     os.environ["XRD_RUNFORKHANDLER"] = "1"  # set multiprocessing flag
67     try:
68         import XRootD
69         import XRootD.client
70 
71     except ImportError:
72         raise ImportError(
73             """Install XRootD python bindings with:
74 
75     conda install -c conda-forge xrootd
76 
77 (or download from http://xrootd.org/dload.html and manually compile with """
78             """cmake; setting PYTHONPATH and LD_LIBRARY_PATH appropriately)."""
79         )
80 
81     if older_xrootd("5.1.0"):
82         # This is registered after calling "import XRootD.client" so it is ran
83         # before XRootD.client.finalize.finalize()
84         @atexit.register
85         def cleanup_open_files():
86             """Clean up any open xrootd file objects at exit
87 
88             Required to avoid deadlocks from XRootD, for details see:
89             * https://github.com/scikit-hep/uproot/issues/504
90             * https://github.com/xrootd/xrootd/pull/1260
91             """
92             import gc
93 
94             for obj in gc.get_objects():
95                 try:
96                     isopen = isinstance(obj, XRootD.client.file.File) and obj.is_open()
97                 except ReferenceError:
98                     pass
99                 else:
100                     if isopen:
101                         obj.close()
102 
103     return XRootD.client
104 
105 
106 def older_xrootd(min_version):
107     """
108     Check if the installed XRootD bindings are newer than a given version
109     without importing. Defaults to False if XRootD is not installed.
110     """
111     try:
112         dist = pkg_resources.get_distribution("XRootD")
113     except pkg_resources.DistributionNotFound:
114         return False
115     else:
116         return LooseVersion(dist.version) < LooseVersion(min_version)
117 
118 
119 def lzma():
120     """
121     Imports and returns ``lzma`` (which is part of the Python 3 standard
122     library, but not Python 2).
123     """
124     try:
125         import lzma
126     except ImportError:
127         try:
128             import backports.lzma as lzma
129         except ImportError:
130             raise ImportError(
131                 """install the 'lzma' package with:
132 
133     pip install backports.lzma
134 
135 or
136 
137     conda install backports.lzma
138 
139 or use Python >= 3.3."""
140             )
141         else:
142             return lzma
143     else:
144         return lzma
145 
146 
147 def lz4_block():
148     """
149     Imports and returns ``lz4``.
150 
151     Attempts to import ``xxhash`` as well.
152     """
153     try:
154         import lz4.block
155         import xxhash  # noqa: F401
156     except ImportError:
157         raise ImportError(
158             """install the 'lz4' and `xxhash` packages with:
159 
160     pip install lz4 xxhash
161 
162 or
163 
164     conda install lz4 python-xxhash"""
165         )
166     else:
167         return lz4.block
168 
169 
170 def xxhash():
171     """
172     Imports and returns ``xxhash``.
173 
174     Attempts to import ``lz4`` as well.
175     """
176     try:
177         import lz4.block  # noqa: F401
178         import xxhash
179     except ImportError:
180         raise ImportError(
181             """install the 'lz4' and `xxhash` packages with:
182 
183     pip install lz4 xxhash
184 
185 or
186 
187     conda install lz4 python-xxhash"""
188         )
189     else:
190         return xxhash
191 
192 
193 def zstandard():
194     """
195     Imports and returns ``zstandard``.
196     """
197     try:
198         import zstandard
199     except ImportError:
200         raise ImportError(
201             """install the 'zstandard' package with:
202 
203     pip install zstandard
204 
205 or
206 
207     conda install zstandard"""
208         )
209     else:
210         return zstandard
211 
212 
213 def boost_histogram():
214     """
215     Imports and returns ``boost-histogram``.
216     """
217     try:
218         import boost_histogram
219     except ImportError:
220         raise ImportError(
221             """install the 'boost-histogram' package with:
222 
223     pip install boost-histogram
224 
225 or
226 
227     conda install -c conda-forge boost-histogram"""
228         )
229     else:
230         return boost_histogram
231 
232 
233 def hist():
234     """
235     Imports and returns ``hist``.
236     """
237     try:
238         import hist
239     except ImportError:
240         raise ImportError(
241             """install the 'hist' package with:
242 
243     pip install hist"""
244         )
245     else:
246         return hist
247
```
--- 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/src/uproot/extras.py b/src/uproot/extras.py
--- a/src/uproot/extras.py
+++ b/src/uproot/extras.py
@@ -106,14 +106,20 @@
 def older_xrootd(min_version):
     """
     Check if the installed XRootD bindings are newer than a given version
-    without importing. Defaults to False if XRootD is not installed.
+    without importing. Defaults to False if XRootD is not installed. Unrecognized
+    versions (i.e. self-built XRootD, whose version numbers are strings)
+    return False: that is, they're assumed to be new, so that no warnings
+    are raised.
     """
     try:
         dist = pkg_resources.get_distribution("XRootD")
     except pkg_resources.DistributionNotFound:
         return False
     else:
-        return LooseVersion(dist.version) < LooseVersion(min_version)
+        try:
+            return LooseVersion(dist.version) < LooseVersion(min_version)
+        except TypeError:
+            return False
 
 
 def lzma():

{"golden_diff": "diff --git a/src/uproot/extras.py b/src/uproot/extras.py\n--- a/src/uproot/extras.py\n+++ b/src/uproot/extras.py\n@@ -106,14 +106,20 @@\n def older_xrootd(min_version):\n     \"\"\"\n     Check if the installed XRootD bindings are newer than a given version\n-    without importing. Defaults to False if XRootD is not installed.\n+    without importing. Defaults to False if XRootD is not installed. Unrecognized\n+    versions (i.e. self-built XRootD, whose version numbers are strings)\n+    return False: that is, they're assumed to be new, so that no warnings\n+    are raised.\n     \"\"\"\n     try:\n         dist = pkg_resources.get_distribution(\"XRootD\")\n     except pkg_resources.DistributionNotFound:\n         return False\n     else:\n-        return LooseVersion(dist.version) < LooseVersion(min_version)\n+        try:\n+            return LooseVersion(dist.version) < LooseVersion(min_version)\n+        except TypeError:\n+            return False\n \n \n def lzma():\n", "issue": "Uproot fails with self-built XRootD\nWith Uproot 4.0.11 and a self-built XRootD with Python bindings, `import uproot` fails with `TypeError: '<' not supported between instances of 'str' and 'int'`. This is due to the following line: https://github.com/scikit-hep/uproot4/blob/d6f9bea0f1a9ca6806445b95da93efa37c5117ba/src/uproot/extras.py#L116\r\n\r\nWhen one builds XRootD, the version number differs from the standard `x.y.z` - it is, e.g., `v20210712-58b374f12`, which causes `LooseVersion` to raise `TypeError`. \n", "before_files": [{"content": "# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE\n\n\"\"\"\nThis module defines functions that import external libraries used by Uproot, but not\nrequired by an Uproot installation. (Uproot only requires NumPy).\n\nIf a library cannot be imported, these functions raise ``ImportError`` with\nerror messages containing instructions on how to install the library.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport atexit\nimport os\nfrom distutils.version import LooseVersion\n\nimport pkg_resources\n\n\ndef awkward():\n    \"\"\"\n    Imports and returns ``awkward``.\n    \"\"\"\n    try:\n        import awkward\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'awkward' package with:\n\n    pip install awkward\n\nAlternatively, you can use ``library=\"np\"`` or globally set ``uproot.default_library``\nto output as NumPy arrays, rather than Awkward arrays.\n\"\"\"\n        )\n    else:\n        return awkward\n\n\ndef pandas():\n    \"\"\"\n    Imports and returns ``pandas``.\n    \"\"\"\n    try:\n        import pandas\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'pandas' package with:\n\n    pip install pandas\n\nor\n\n    conda install pandas\"\"\"\n        )\n    else:\n        return pandas\n\n\ndef XRootD_client():\n    \"\"\"\n    Imports and returns ``XRootD.client`` (after setting the\n    ```XRD_RUNFORKHANDLER`` environment variable to ``\"1\"``, to allow\n    multiprocessing).\n    \"\"\"\n    os.environ[\"XRD_RUNFORKHANDLER\"] = \"1\"  # set multiprocessing flag\n    try:\n        import XRootD\n        import XRootD.client\n\n    except ImportError:\n        raise ImportError(\n            \"\"\"Install XRootD python bindings with:\n\n    conda install -c conda-forge xrootd\n\n(or download from http://xrootd.org/dload.html and manually compile with \"\"\"\n            \"\"\"cmake; setting PYTHONPATH and LD_LIBRARY_PATH appropriately).\"\"\"\n        )\n\n    if older_xrootd(\"5.1.0\"):\n        # This is registered after calling \"import XRootD.client\" so it is ran\n        # before XRootD.client.finalize.finalize()\n        @atexit.register\n        def cleanup_open_files():\n            \"\"\"Clean up any open xrootd file objects at exit\n\n            Required to avoid deadlocks from XRootD, for details see:\n            * https://github.com/scikit-hep/uproot/issues/504\n            * https://github.com/xrootd/xrootd/pull/1260\n            \"\"\"\n            import gc\n\n            for obj in gc.get_objects():\n                try:\n                    isopen = isinstance(obj, XRootD.client.file.File) and obj.is_open()\n                except ReferenceError:\n                    pass\n                else:\n                    if isopen:\n                        obj.close()\n\n    return XRootD.client\n\n\ndef older_xrootd(min_version):\n    \"\"\"\n    Check if the installed XRootD bindings are newer than a given version\n    without importing. Defaults to False if XRootD is not installed.\n    \"\"\"\n    try:\n        dist = pkg_resources.get_distribution(\"XRootD\")\n    except pkg_resources.DistributionNotFound:\n        return False\n    else:\n        return LooseVersion(dist.version) < LooseVersion(min_version)\n\n\ndef lzma():\n    \"\"\"\n    Imports and returns ``lzma`` (which is part of the Python 3 standard\n    library, but not Python 2).\n    \"\"\"\n    try:\n        import lzma\n    except ImportError:\n        try:\n            import backports.lzma as lzma\n        except ImportError:\n            raise ImportError(\n                \"\"\"install the 'lzma' package with:\n\n    pip install backports.lzma\n\nor\n\n    conda install backports.lzma\n\nor use Python >= 3.3.\"\"\"\n            )\n        else:\n            return lzma\n    else:\n        return lzma\n\n\ndef lz4_block():\n    \"\"\"\n    Imports and returns ``lz4``.\n\n    Attempts to import ``xxhash`` as well.\n    \"\"\"\n    try:\n        import lz4.block\n        import xxhash  # noqa: F401\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'lz4' and `xxhash` packages with:\n\n    pip install lz4 xxhash\n\nor\n\n    conda install lz4 python-xxhash\"\"\"\n        )\n    else:\n        return lz4.block\n\n\ndef xxhash():\n    \"\"\"\n    Imports and returns ``xxhash``.\n\n    Attempts to import ``lz4`` as well.\n    \"\"\"\n    try:\n        import lz4.block  # noqa: F401\n        import xxhash\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'lz4' and `xxhash` packages with:\n\n    pip install lz4 xxhash\n\nor\n\n    conda install lz4 python-xxhash\"\"\"\n        )\n    else:\n        return xxhash\n\n\ndef zstandard():\n    \"\"\"\n    Imports and returns ``zstandard``.\n    \"\"\"\n    try:\n        import zstandard\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'zstandard' package with:\n\n    pip install zstandard\n\nor\n\n    conda install zstandard\"\"\"\n        )\n    else:\n        return zstandard\n\n\ndef boost_histogram():\n    \"\"\"\n    Imports and returns ``boost-histogram``.\n    \"\"\"\n    try:\n        import boost_histogram\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'boost-histogram' package with:\n\n    pip install boost-histogram\n\nor\n\n    conda install -c conda-forge boost-histogram\"\"\"\n        )\n    else:\n        return boost_histogram\n\n\ndef hist():\n    \"\"\"\n    Imports and returns ``hist``.\n    \"\"\"\n    try:\n        import hist\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'hist' package with:\n\n    pip install hist\"\"\"\n        )\n    else:\n        return hist\n", "path": "src/uproot/extras.py"}], "after_files": [{"content": "# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE\n\n\"\"\"\nThis module defines functions that import external libraries used by Uproot, but not\nrequired by an Uproot installation. (Uproot only requires NumPy).\n\nIf a library cannot be imported, these functions raise ``ImportError`` with\nerror messages containing instructions on how to install the library.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport atexit\nimport os\nfrom distutils.version import LooseVersion\n\nimport pkg_resources\n\n\ndef awkward():\n    \"\"\"\n    Imports and returns ``awkward``.\n    \"\"\"\n    try:\n        import awkward\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'awkward' package with:\n\n    pip install awkward\n\nAlternatively, you can use ``library=\"np\"`` or globally set ``uproot.default_library``\nto output as NumPy arrays, rather than Awkward arrays.\n\"\"\"\n        )\n    else:\n        return awkward\n\n\ndef pandas():\n    \"\"\"\n    Imports and returns ``pandas``.\n    \"\"\"\n    try:\n        import pandas\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'pandas' package with:\n\n    pip install pandas\n\nor\n\n    conda install pandas\"\"\"\n        )\n    else:\n        return pandas\n\n\ndef XRootD_client():\n    \"\"\"\n    Imports and returns ``XRootD.client`` (after setting the\n    ```XRD_RUNFORKHANDLER`` environment variable to ``\"1\"``, to allow\n    multiprocessing).\n    \"\"\"\n    os.environ[\"XRD_RUNFORKHANDLER\"] = \"1\"  # set multiprocessing flag\n    try:\n        import XRootD\n        import XRootD.client\n\n    except ImportError:\n        raise ImportError(\n            \"\"\"Install XRootD python bindings with:\n\n    conda install -c conda-forge xrootd\n\n(or download from http://xrootd.org/dload.html and manually compile with \"\"\"\n            \"\"\"cmake; setting PYTHONPATH and LD_LIBRARY_PATH appropriately).\"\"\"\n        )\n\n    if older_xrootd(\"5.1.0\"):\n        # This is registered after calling \"import XRootD.client\" so it is ran\n        # before XRootD.client.finalize.finalize()\n        @atexit.register\n        def cleanup_open_files():\n            \"\"\"Clean up any open xrootd file objects at exit\n\n            Required to avoid deadlocks from XRootD, for details see:\n            * https://github.com/scikit-hep/uproot/issues/504\n            * https://github.com/xrootd/xrootd/pull/1260\n            \"\"\"\n            import gc\n\n            for obj in gc.get_objects():\n                try:\n                    isopen = isinstance(obj, XRootD.client.file.File) and obj.is_open()\n                except ReferenceError:\n                    pass\n                else:\n                    if isopen:\n                        obj.close()\n\n    return XRootD.client\n\n\ndef older_xrootd(min_version):\n    \"\"\"\n    Check if the installed XRootD bindings are newer than a given version\n    without importing. Defaults to False if XRootD is not installed. Unrecognized\n    versions (i.e. self-built XRootD, whose version numbers are strings)\n    return False: that is, they're assumed to be new, so that no warnings\n    are raised.\n    \"\"\"\n    try:\n        dist = pkg_resources.get_distribution(\"XRootD\")\n    except pkg_resources.DistributionNotFound:\n        return False\n    else:\n        try:\n            return LooseVersion(dist.version) < LooseVersion(min_version)\n        except TypeError:\n            return False\n\n\ndef lzma():\n    \"\"\"\n    Imports and returns ``lzma`` (which is part of the Python 3 standard\n    library, but not Python 2).\n    \"\"\"\n    try:\n        import lzma\n    except ImportError:\n        try:\n            import backports.lzma as lzma\n        except ImportError:\n            raise ImportError(\n                \"\"\"install the 'lzma' package with:\n\n    pip install backports.lzma\n\nor\n\n    conda install backports.lzma\n\nor use Python >= 3.3.\"\"\"\n            )\n        else:\n            return lzma\n    else:\n        return lzma\n\n\ndef lz4_block():\n    \"\"\"\n    Imports and returns ``lz4``.\n\n    Attempts to import ``xxhash`` as well.\n    \"\"\"\n    try:\n        import lz4.block\n        import xxhash  # noqa: F401\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'lz4' and `xxhash` packages with:\n\n    pip install lz4 xxhash\n\nor\n\n    conda install lz4 python-xxhash\"\"\"\n        )\n    else:\n        return lz4.block\n\n\ndef xxhash():\n    \"\"\"\n    Imports and returns ``xxhash``.\n\n    Attempts to import ``lz4`` as well.\n    \"\"\"\n    try:\n        import lz4.block  # noqa: F401\n        import xxhash\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'lz4' and `xxhash` packages with:\n\n    pip install lz4 xxhash\n\nor\n\n    conda install lz4 python-xxhash\"\"\"\n        )\n    else:\n        return xxhash\n\n\ndef zstandard():\n    \"\"\"\n    Imports and returns ``zstandard``.\n    \"\"\"\n    try:\n        import zstandard\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'zstandard' package with:\n\n    pip install zstandard\n\nor\n\n    conda install zstandard\"\"\"\n        )\n    else:\n        return zstandard\n\n\ndef boost_histogram():\n    \"\"\"\n    Imports and returns ``boost-histogram``.\n    \"\"\"\n    try:\n        import boost_histogram\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'boost-histogram' package with:\n\n    pip install boost-histogram\n\nor\n\n    conda install -c conda-forge boost-histogram\"\"\"\n        )\n    else:\n        return boost_histogram\n\n\ndef hist():\n    \"\"\"\n    Imports and returns ``hist``.\n    \"\"\"\n    try:\n        import hist\n    except ImportError:\n        raise ImportError(\n            \"\"\"install the 'hist' package with:\n\n    pip install hist\"\"\"\n        )\n    else:\n        return hist\n", "path": "src/uproot/extras.py"}]}