o ]Lb @sddlmZddlZddlZddlZddlmZddZer5eedddkr5ej ej Z e Z d d Znej ej eeZ ej e Z d d Zz dd lmZejWneefyod dZddZddZYdSwddlmZddZddZddZdS))absolute_importN)pycompatcCs"ttdpttdptdS)zreturn True if we are a frozen executable. The code supports py2exe (most common, Windows only) and tools/freeze (portable, not much used). frozen importers__main__)r safehasattrsysimp is_frozenr r >/usr/lib/python3/dist-packages/mercurial/utils/resourceutil.py mainfrozens  rr macosx_appcCs6|d}|ddks Jtjjtg|ddRS)N.rs mercurial)splitospathjoin _rootpath)packagedirsr r r _package_path+s rcCstjjtg|dRS)Nr)rrrrr)rr r r r5s) resourcescCstjt||}t|dS)Nrb)rrrropenrnamerr r r open_resourceEs rc Cs@tjt||}z tjt|WSttfyYdSw)NF) rrrrisfilerfsdecodeIOErrorOSErrorrr r r is_resourceIs r$ccs0tt|}t|D]}t|Vq dSN)rr!rrlistdirfsencode)rrpr r r contentsQs r))encodingcCstt|t|Sr%)r open_binaryrsysstrrrr r r r[cCstt|t|Sr%)rr$rr,r* strfromlocalr-r r r r$`r.ccs(tt|D]}t|Vq dSr%)rr)rr,r* strtolocal)rrr r r r)es) __future__rr rr rrgetattrrdirname sysexecutabledatapathrrr'__file__ importlibrr+ ImportErrorAttributeErrorrr$r)r*r r r r s2