fix: remove redundant import os, use Path().name instead

This commit is contained in:
Chesars 2026-03-11 13:37:52 -03:00
parent abe0c40c1a
commit d7c2532137

View file

@ -5,7 +5,6 @@ Common utility functions used for translating messages across providers
import io
import mimetypes
import re
import os
from os import PathLike
from pathlib import Path
from typing import (
@ -647,7 +646,7 @@ def extract_file_data(file_data: FileTypes) -> ExtractedFileData:
# If it's a file-like object
# Try to get filename from file handle if not already set
if not filename and hasattr(file_content, 'name'):
filename = os.path.basename(file_content.name)
filename = Path(file_content.name).name
content = file_content.read()