Skip to content

Commit 7585e04

Browse files
committed
fix uri_parser
1 parent 63ba7be commit 7585e04

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

pymongo/uri_parser.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025-present MongoDB, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Re-import of synchronous Uri Parser API for compatibility."""
16+
from __future__ import annotations
17+
18+
from pymongo.synchronous.uri_parser import * # noqa: F403
19+
from pymongo.synchronous.uri_parser import __doc__ as original_doc
20+
from pymongo.uri_parser_shared import * # noqa: F403
21+
22+
__doc__ = original_doc
23+
__all__ = [ # noqa: F405
24+
"parse_userinfo",
25+
"parse_ipv6_literal_host",
26+
"parse_host",
27+
"validate_options",
28+
"split_options",
29+
"split_hosts",
30+
"parse_uri",
31+
]

test/test_uri_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
from test import unittest
2828
from test.helpers import clear_warning_registry
2929

30-
from pymongo.asynchronous.uri_parser import parse_uri
3130
from pymongo.common import INTERNAL_URI_OPTION_NAME_MAP, validate
3231
from pymongo.compression_support import _have_snappy
32+
from pymongo.synchronous.uri_parser import parse_uri
3333

3434
CONN_STRING_TEST_PATH = os.path.join(
3535
os.path.dirname(os.path.realpath(__file__)), os.path.join("connection_string", "test")

0 commit comments

Comments
 (0)