1. Cat's Eye Technologies
  2. Eightebed

Commits

catseye  committed 5dfee14

Allow load-and-go operation under Cygwin.

  • Participants
  • Parent commits 553f4b5
  • Branches default

Comments (0)

Files changed (2)

File src/8ebed2c.py

View file
  • Ignore whitespace
 """
 
 import logging
-import os
 import sys
 
 from optparse import OptionParser

File src/eightebed/drivers.py

View file
  • Ignore whitespace
 
 
 def compile_and_run(filename, options):
+    # a bit of a hack
+    a_out = './a.out'
+    if sys.platform == 'cygwin':
+        a_out = './a.exe'
+
     logger.info("Compiling...")
     output = Popen([options.compiler, filename], stdout=PIPE).communicate()[0]
     if options.verbose:
         raise RuntimeError("Compilation failed!")
     if options.run:
         logger.info("Running...")
-        output = Popen(["./a.out"], stdout=PIPE).communicate()[0]
+        output = Popen([a_out], stdout=PIPE).communicate()[0]
     if options.clean:
         os.remove(filename)
-        os.remove("./a.out")
+        os.remove(a_out)
     return output