Skip to content

Commit

Permalink
Ignore warnings when reading pickle files (#19580)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and jreback committed Feb 9, 2018
1 parent b835127 commit f30345f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/io/pickle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" pickle compat """
import warnings

import numpy as np
from numpy.lib.format import read_array, write_array
Expand Down Expand Up @@ -96,7 +97,9 @@ def try_read(path, encoding=None):
# cpickle
# GH 6899
try:
return read_wrapper(lambda f: pkl.load(f))
with warnings.catch_warnings(record=True):
# We want to silencce any warnings about, e.g. moved modules.
return read_wrapper(lambda f: pkl.load(f))
except Exception:
# reg/patched pickle
try:
Expand Down

0 comments on commit f30345f

Please sign in to comment.