Skip to content

Commit

Permalink
Merge pull request #272 from Medno/fix_typing
Browse files Browse the repository at this point in the history
Fix type annotations for earlier Python versions
  • Loading branch information
fhamborg authored Jul 3, 2024
2 parents 4bcedc9 + b2bbc56 commit 6efc80d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions newsplease/helper_classes/url_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import os
import re
from typing import Optional
from scrapy.http import Response
from http.client import HTTPResponse
from urllib.error import URLError
Expand Down Expand Up @@ -61,7 +62,7 @@ def get_subdomain(url: str) -> str:
]

@staticmethod
def follow_redirects(url):
def follow_redirects(url: str) -> str:
"""
Get's the url actual address by following forwards
Expand Down Expand Up @@ -98,7 +99,7 @@ def check_sitemap_urls(domain_url: str) -> list[str]:
return working_sitemap_paths

@staticmethod
def get_robots_response(url: str, allow_subdomains: bool) -> HTTPResponse | None:
def get_robots_response(url: str, allow_subdomains: bool) -> Optional[HTTPResponse]:
"""
Retrieve robots.txt response if it exists
Expand Down

0 comments on commit 6efc80d

Please sign in to comment.