Skip to content

Commit e6bf1a7

Browse files
Aaron KanzerAaron Kanzer
authored andcommitted
revert uncommented out code
1 parent 5ad60a1 commit e6bf1a7

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

dandi/utils.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -604,19 +604,19 @@ def _get_instance(
604604
f"Could not retrieve server info from {url},"
605605
" and client does not recognize URL"
606606
)
607-
# try:
608-
# minversion = Version(server_info.cli_minimal_version)
609-
# bad_versions = [Version(v) for v in server_info.cli_bad_versions]
610-
# except ValueError as e:
611-
# raise ValueError(
612-
# f"{url} returned an incorrectly formatted version;"
613-
# f" please contact that server's administrators: {e}"
614-
# )
615-
# our_version = Version(__version__)
616-
# if our_version < minversion:
617-
# raise CliVersionTooOldError(our_version, minversion, bad_versions)
618-
# if our_version in bad_versions:
619-
# raise BadCliVersionError(our_version, minversion, bad_versions)
607+
try:
608+
minversion = Version(server_info.cli_minimal_version)
609+
bad_versions = [Version(v) for v in server_info.cli_bad_versions]
610+
except ValueError as e:
611+
raise ValueError(
612+
f"{url} returned an incorrectly formatted version;"
613+
f" please contact that server's administrators: {e}"
614+
)
615+
our_version = Version(__version__)
616+
if our_version < minversion:
617+
raise CliVersionTooOldError(our_version, minversion, bad_versions)
618+
if our_version in bad_versions:
619+
raise BadCliVersionError(our_version, minversion, bad_versions)
620620
api_url = server_info.services.api.url
621621
if dandi_id is None:
622622
# Don't use pydantic.AnyHttpUrl, as that sets the `port` attribute even
@@ -642,7 +642,7 @@ def _get_instance(
642642

643643

644644
def is_url(s: str) -> bool:
645-
"""Very primitive url detection
645+
"""Very primitive url detection for now
646646
647647
TODO: redo
648648
"""

0 commit comments

Comments
 (0)