File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ def build_variable(
306306 else :
307307 var .min = int (min_string , 0 )
308308 except ValueError :
309- logger . warning ( "Failed to parse LowLimit for %s: %r" , name , min_string )
309+ pass
310310 if eds .has_option (section , "HighLimit" ):
311311 try :
312312 max_string = eds .get (section , "HighLimit" )
@@ -315,7 +315,7 @@ def build_variable(
315315 else :
316316 var .max = int (max_string , 0 )
317317 except ValueError :
318- logger . warning ( "Failed to parse HighLimit for %s: %r" , name , max_string )
318+ pass
319319 if eds .has_option (section , "DefaultValue" ):
320320 try :
321321 var .default_raw = eds .get (section , "DefaultValue" )
Original file line number Diff line number Diff line change @@ -154,23 +154,6 @@ def test_record_with_limits(self):
154154 self .assertEqual (var .min , - 1 , f"min mismatch at 0x{ index :04X} " )
155155 self .assertEqual (var .max , 0 , f"max mismatch at 0x{ index :04X} " )
156156
157- def test_invalid_limit_logs_warning (self ):
158- import io
159- import logging
160-
161- with open (SAMPLE_EDS ) as f :
162- content = f .read ()
163- invalid_eds = content .replace (
164- "LowLimit=0x02\n PDOMapping=0\n \n [3030]" ,
165- "LowLimit=INVALID\n PDOMapping=0\n \n [3030]" ,
166- )
167- with io .StringIO (invalid_eds ) as buf :
168- buf .name = "mock.eds"
169- with self .assertLogs ("canopen.objectdictionary.eds" , level = logging .WARNING ) as cm :
170- od = canopen .import_od (buf )
171- self .assertIsNone (od [0x3021 ].min )
172- self .assertTrue (any ("LowLimit" in msg for msg in cm .output ))
173-
174157 def test_signed_int_from_hex (self ):
175158 for data_type , test_cases in self .test_data .items ():
176159 for test_case in test_cases :
You can’t perform that action at this time.
0 commit comments