Skip to content

Commit 1e629af

Browse files
nejchJohnVillalovos
authored andcommitted
chore: make backends private
1 parent ea7010b commit 1e629af

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
File renamed without changes.

gitlab/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import gitlab.config
1313
import gitlab.const
1414
import gitlab.exceptions
15-
from gitlab import http_backends, utils
15+
from gitlab import _backends, utils
1616

1717
REDIRECT_MSG = (
1818
"python-gitlab detected a {status_code} ({reason!r}) redirection. You must update "
@@ -52,9 +52,9 @@ class Gitlab:
5252
keep_base_url: keep user-provided base URL for pagination if it
5353
differs from response headers
5454
55-
Keyward Args:
56-
requests.Session session: Http Requests Session
57-
RequestsBackend http_backend: Backend that will be used to make http requests
55+
Keyword Args:
56+
requests.Session session: HTTP Requests Session
57+
RequestsBackend backend: Backend that will be used to make http requests
5858
"""
5959

6060
def __init__(
@@ -99,11 +99,11 @@ def __init__(
9999
self._set_auth_info()
100100

101101
#: Create a session object for requests
102-
http_backend: Type[http_backends.DefaultBackend] = kwargs.pop(
103-
"http_backend", http_backends.DefaultBackend
102+
_backend: Type[_backends.DefaultBackend] = kwargs.pop(
103+
"backend", _backends.DefaultBackend
104104
)
105-
self.http_backend = http_backend(**kwargs)
106-
self.session = self.http_backend.client
105+
self._backend = _backend(**kwargs)
106+
self.session = self._backend.client
107107

108108
self.per_page = per_page
109109
self.pagination = pagination
@@ -716,15 +716,15 @@ def http_request(
716716
retry_transient_errors = self.retry_transient_errors
717717

718718
# We need to deal with json vs. data when uploading files
719-
json, data, content_type = self.http_backend.prepare_send_data(
719+
json, data, content_type = self._backend.prepare_send_data(
720720
files, post_data, raw
721721
)
722722
opts["headers"]["Content-type"] = content_type
723723

724724
cur_retries = 0
725725
while True:
726726
try:
727-
result = self.http_backend.http_request(
727+
result = self._backend.http_request(
728728
method=verb,
729729
url=url,
730730
json=json,

0 commit comments

Comments
 (0)