Skip to content

Commit 949f351

Browse files
committed
PYTHON-5506 Cleaner time import
1 parent 752d8c0 commit 949f351

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

pymongo/asynchronous/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import random
2222
import socket
2323
import sys
24-
import time
24+
import time as time # noqa: PLC0414 # needed in sync version
2525
from typing import (
2626
Any,
2727
Callable,
@@ -83,7 +83,6 @@ async def inner(*args: Any, **kwargs: Any) -> Any:
8383
# DRIVERS-3240 will determine these defaults.
8484
DEFAULT_RETRY_TOKEN_CAPACITY = 1000.0
8585
DEFAULT_RETRY_TOKEN_RETURN = 0.1
86-
_TIME = time # Added so synchro script doesn't remove the time import.
8786

8887

8988
def _backoff(

pymongo/asynchronous/mongo_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import asyncio
3636
import contextlib
3737
import os
38-
import time
38+
import time as time # noqa: PLC0414 # needed in sync version
3939
import warnings
4040
import weakref
4141
from collections import defaultdict
@@ -175,8 +175,6 @@
175175
UpdateMany,
176176
]
177177

178-
_TIME = time # Added so synchro script doesn't remove the time import.
179-
180178

181179
class AsyncMongoClient(common.BaseObject, Generic[_DocumentType]):
182180
HOST = "localhost"

pymongo/synchronous/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import random
2222
import socket
2323
import sys
24-
import time
24+
import time as time # noqa: PLC0414 # needed in sync version
2525
from typing import (
2626
Any,
2727
Callable,
@@ -83,7 +83,6 @@ def inner(*args: Any, **kwargs: Any) -> Any:
8383
# DRIVERS-3240 will determine these defaults.
8484
DEFAULT_RETRY_TOKEN_CAPACITY = 1000.0
8585
DEFAULT_RETRY_TOKEN_RETURN = 0.1
86-
_TIME = time # Added so synchro script doesn't remove the time import.
8786

8887

8988
def _backoff(

pymongo/synchronous/mongo_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import asyncio
3636
import contextlib
3737
import os
38-
import time
38+
import time as time # noqa: PLC0414 # needed in sync version
3939
import warnings
4040
import weakref
4141
from collections import defaultdict
@@ -172,8 +172,6 @@
172172
UpdateMany,
173173
]
174174

175-
_TIME = time # Added so synchro script doesn't remove the time import.
176-
177175

178176
class MongoClient(common.BaseObject, Generic[_DocumentType]):
179177
HOST = "localhost"

0 commit comments

Comments
 (0)