Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/netaddr/compat.py: 50%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

6 statements  

1# ----------------------------------------------------------------------------- 

2# Copyright (c) 2008 by David P. D. Moss. All rights reserved. 

3# 

4# Released under the BSD license. See the LICENSE file for details. 

5# ----------------------------------------------------------------------------- 

6 

7 

8import importlib.resources 

9 

10if hasattr(importlib.resources, 'files'): 

11 

12 def _open_binary(pkg, res): 

13 return importlib.resources.files(pkg).joinpath(res).open('rb') 

14else: 

15 _open_binary = importlib.resources.open_binary