fix: Use Optional[] for forward reference type union (Python 3.10 compat)
- Changed 'pathspec.PathSpec' | None to Optional['pathspec.PathSpec'] - Fixes TypeError in Python 3.10/3.11 where | operator doesn't work with string literals - Adds Optional to typing imports
This commit is contained in:
@@ -21,7 +21,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
try:
|
||||
from github import Github, GithubException, Repository
|
||||
@@ -563,7 +563,7 @@ class GitHubScraper:
|
||||
|
||||
return False
|
||||
|
||||
def _load_gitignore(self) -> "pathspec.PathSpec" | None:
|
||||
def _load_gitignore(self) -> Optional["pathspec.PathSpec"]:
|
||||
"""
|
||||
Load .gitignore file and create pathspec matcher (C2.1).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user