o inhZ @sfdZddlZejddkrCejZeZeZ ddZ ddZ ddZ ddZ d dZd dZd dZd d ZddZddZeZddZnEejddddgkrejZeefZeZ eZ ddZ ddZ ddZ ddZddZddZdd ZddZddZeZddZnedzdd lmZWn eyddl ZYnwzej!Z"WdSe#yd!d"Z"YdSw)#z Compatibility wrappers providing uniform behaviour for Python code required to run under both Python 2.x and 3.x. All operations emulate 2.x behaviour where applicable. NcC t|dS)NzUTF-8)bytesxr9/usr/local/lib/python3.10/dist-packages/netaddr/compat.py r cCst|ttdfSN) isinstancestrtypeencoderrrrr scC t|tSN)r intrrrrr r cCr)N__call__)hasattrrrrrr r cC t|Sr)listkeysrrrrr  cCrr)ritemsrrrrr rcC|Srrrrrrr "cGsdj|Sr )rjoinargsrrr _bytes_join$r!cGs tt|Sr)rziprrrr_zip's r$cOstt|i|Sr)rranger kwargsrrr_range*sr(cCt|Srnextrrrr _iter_next/r,cCrr)r basestringrrrrr <r cCst|ttfSr)r rlongrrrrr >scCr)r)callablerrrrr @rcCrrrrrrrr BrcCrr)rrrrrr DrcCrr)iterrrrrrr FrcGs dj|Sr )rrrrrr!Hs cGst|Sr)r#rrrrr$Kr-cOst|i|Sr)r%r&rrrr(Nr"cCrrr*rrrrr,Sr-zAthis module only supports Python 2.4.x or higher (including 3.x)!) resourcescCst||dS)Nrb)_importlib_resourcesfilesjoinpathopen)pkgresrrr _open_binarybsr;)$__doc__sys_sys version_infomaxsize _sys_maxintr _int_typer _str_type _bytes_type_is_str_is_int _callable _dict_keys _dict_items_iter_dict_keysr!r$r(r% _iter_ranger,maxintr0r/xrange RuntimeError importlibr3r5 ImportErrorimportlib_resources open_binaryr;AttributeErrorrrrrs^