Skip to content

Commit

Permalink
wow this took too long
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Nov 21, 2023
1 parent 1392db6 commit 222c0a2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing_extensions import TYPE_CHECKING, Literal
from typing import Optional
import sys
import sys as _sys
import os

# Stripe Python bindings
Expand All @@ -18,6 +18,7 @@
if TYPE_CHECKING:
from stripe.http_client import HTTPClient

_this_module = _sys.modules[__name__]
api_key: Optional[str] = None
client_id: Optional[str] = None
api_base: str = "https://api.stripe.com"
Expand Down Expand Up @@ -145,7 +146,7 @@ def set_app_info(
# Python 3.7+ supports module level __getattr__ that allows us to lazy load deprecated modules
# this matters because if we pre-load all modules from api_resources while suppressing warning
# users will never see those warnings
if sys.version_info[:3] > (3, 6):
if _sys.version_info[:2] >= (3, 7):

def __getattr__(name):
if name == "abstract":
Expand All @@ -161,11 +162,8 @@ def __getattr__(name):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)

import stripe.api_resources.abstract as _abstract
import stripe.api_resources as _api_resources

globals()["abstract"] = _abstract
globals()["api_resources"] = _api_resources
import stripe.api_resources.abstract as abstract
import stripe.api_resources as api_resources


# API resources
Expand Down

0 comments on commit 222c0a2

Please sign in to comment.