Skip to content

Commit

Permalink
Suppress a deprecation warning from ROS
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Feb 26, 2024
1 parent 6d674e5 commit 253ea5a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/velodyne_decoder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import struct
from contextlib import contextmanager
import warnings

import dpkt
import numpy as np
Expand All @@ -28,8 +29,11 @@ def iter_pcap(pcap_file, time_range=(None, None)):


def iter_bag(bag_file, topics=None, default_msg_types=None, time_range=(None, None)):
from rosbag import Bag
from rospy import Time
with warnings.catch_warnings():
# Suppress an irrelevant deprecation warning from the Cryptodome package due to 'import imp'
warnings.filterwarnings("ignore", category=DeprecationWarning)
from rosbag import Bag
from rospy import Time

if isinstance(bag_file, Bag):
bag = bag_file
Expand Down

0 comments on commit 253ea5a

Please sign in to comment.