Files
Hotel-Booking/Backend/venv/lib/python3.12/site-packages/bandit/formatters/utils.py
Iliyan Angelov 62c1fe5951 updates
2025-12-01 06:50:10 +02:00

15 lines
390 B
Python

# Copyright (c) 2016 Rackspace, Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""Utility functions for formatting plugins for Bandit."""
import io
def wrap_file_object(fileobj):
"""If the fileobj passed in cannot handle text, use TextIOWrapper
to handle the conversion.
"""
if isinstance(fileobj, io.TextIOBase):
return fileobj
return io.TextIOWrapper(fileobj)