Skip to content

Commit

Permalink
chore: make backends private
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Jan 30, 2023
1 parent ea7010b commit 1e629af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions gitlab/client.py
Expand Up @@ -12,7 +12,7 @@
import gitlab.config
import gitlab.const
import gitlab.exceptions
from gitlab import http_backends, utils
from gitlab import _backends, utils

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

def __init__(
Expand Down Expand Up @@ -99,11 +99,11 @@ def __init__(
self._set_auth_info()

#: Create a session object for requests
http_backend: Type[http_backends.DefaultBackend] = kwargs.pop(
"http_backend", http_backends.DefaultBackend
_backend: Type[_backends.DefaultBackend] = kwargs.pop(
"backend", _backends.DefaultBackend
)
self.http_backend = http_backend(**kwargs)
self.session = self.http_backend.client
self._backend = _backend(**kwargs)
self.session = self._backend.client

self.per_page = per_page
self.pagination = pagination
Expand Down Expand Up @@ -716,15 +716,15 @@ def http_request(
retry_transient_errors = self.retry_transient_errors

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

cur_retries = 0
while True:
try:
result = self.http_backend.http_request(
result = self._backend.http_request(
method=verb,
url=url,
json=json,
Expand Down

0 comments on commit 1e629af

Please sign in to comment.