mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
* Increment version and add Python2.x deprecation warning Change test to actually test no warnings when on python3 flake8 compliant * fix development status classifier
25 lines
602 B
Python
25 lines
602 B
Python
import logging
|
|
import warnings
|
|
import sys
|
|
from .config import VCR
|
|
|
|
# Set default logging handler to avoid "No handler found" warnings.
|
|
try: # Python 2.7+
|
|
from logging import NullHandler
|
|
except ImportError:
|
|
class NullHandler(logging.Handler):
|
|
def emit(self, record):
|
|
pass
|
|
|
|
if sys.version_info[0] == 2:
|
|
warnings.warn(
|
|
"Python 2.x support of vcrpy is deprecated and will be removed in an upcoming major release.",
|
|
DeprecationWarning
|
|
)
|
|
|
|
logging.getLogger(__name__).addHandler(NullHandler())
|
|
|
|
|
|
default_vcr = VCR()
|
|
use_cassette = default_vcr.use_cassette
|