fix: Python 3.6 compatibility for tests

- Replace walrus operator (:=) with traditional assignment in config.py
- Replace datetime.fromisoformat() with strptime() for Python 3.6
- Replace subprocess capture_output and text params with PIPE and universal_newlines
- All tests now pass on Python 3.6.9

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-23 01:40:37 +02:00
parent 7bdc21d3ef
commit 7b9d6af5a1
4 changed files with 21 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ Issue fetching from Gitea API.
import json
import subprocess
from subprocess import PIPE
from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional, Dict, Any
@@ -42,8 +43,9 @@ class IssueFetcher:
try:
result = subprocess.run(
['curl', '-s', f"{self.config.issues_api_url}/{issue_number}"],
capture_output=True,
text=True,
stdout=PIPE,
stderr=PIPE,
universal_newlines=True,
check=True
)
@@ -71,8 +73,9 @@ class IssueFetcher:
result = subprocess.run(
['curl', '-s', url],
capture_output=True,
text=True,
stdout=PIPE,
stderr=PIPE,
universal_newlines=True,
check=True
)
@@ -111,8 +114,8 @@ class IssueFetcher:
title=issue_data['title'],
body=issue_data.get('body', ''),
state=issue_data['state'],
created_at=datetime.fromisoformat(issue_data['created_at'].replace('Z', '+00:00')),
updated_at=datetime.fromisoformat(issue_data['updated_at'].replace('Z', '+00:00')),
created_at=datetime.strptime(issue_data['created_at'].replace('Z', '').split('.')[0], '%Y-%m-%dT%H:%M:%S'),
updated_at=datetime.strptime(issue_data['updated_at'].replace('Z', '').split('.')[0], '%Y-%m-%dT%H:%M:%S'),
html_url=issue_data['html_url'],
assignee=assignee,
labels=labels