Skip to content

Commit

Permalink
Use typing.Self
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Nov 4, 2023
1 parent 72c2373 commit ad4bde9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitblame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
from functools import cache
from datetime import datetime
from typing import Self

import requests
from requests import RequestException
Expand Down Expand Up @@ -58,10 +59,10 @@ def __init__(self, repo: str, branch: str, access_token: str) -> None:
self.session.hooks["response"].append(debugme)
self.blame_file = cache(self._blame_file)

def __enter__(self):
def __enter__(self) -> Self:
return self

def __exit__(self, exc_type, exc_value, traceback):
def __exit__(self, exc_type, exc_value, traceback) -> None:
try:
self.session.close()
except RequestException:
Expand Down

0 comments on commit ad4bde9

Please sign in to comment.