openbmc icon indicating copy to clipboard operation
openbmc copied to clipboard

Making the except block more explicit, to catch OSError.

Open mohitanand001 opened this issue 5 years ago • 2 comments

https://github.com/facebook/openbmc/blob/6cc8067ba824df537dfd0597473d578b55e65639/tests/fbtp/unittests/FbtpUtil.py#L28-L33

Can the above snippet be changed to the following?

 try: 
     currentPath = os.getcwd() 
     commonPath = currentPath.replace('fbtp/unittests', 'common') 
     sys.path.insert(0, commonPath) 
 except OSError: 
     pass

Can I raise a PR for this?

mohitanand001 avatar May 28 '19 05:05 mohitanand001

Hi @farziengineer , that's a great point! Please raise a PR. Thank you!

benwei13 avatar Jun 07 '19 03:06 benwei13

.

Goforitzjl avatar Sep 18 '19 03:09 Goforitzjl