Skip to content

Instantly share code, notes, and snippets.

@ianoxley
Created October 9, 2009 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianoxley/206177 to your computer and use it in GitHub Desktop.
Save ianoxley/206177 to your computer and use it in GitHub Desktop.
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