Created
October 9, 2009 16:58
-
-
Save ianoxley/206177 to your computer and use it in GitHub Desktop.
An Iron Python implemtation of this: http://chillijam.co.uk/2006/05/04/determine-if-an-assembly-is-a-debug-or-release-build/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System | |
def is_assembly_debug_build(filename): | |
"""Returns true if filename appears to have been built in debug mode""" | |
result = False | |
dll = System.Reflection.Assembly.LoadFile(filename) | |
customAttribs = dll.GetCustomAttributes(False) | |
for att in customAttribs: | |
if att.GetType() == System.Type.GetType("System.Diagnostics.DebuggableAttribute"): | |
result = att.IsJITTrackingEnabled | |
return result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment