euler314 commited on
Commit
893a672
·
verified ·
1 Parent(s): da0727f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -181,6 +181,10 @@ def find_compiled_binary(output_dir, output_filename):
181
 
182
  def compile_with_nuitka(code, requirements, packages, compilation_mode, output_extension, log_queue, progress_callback=None):
183
  """Compile Python code with Nuitka"""
 
 
 
 
184
  try:
185
  # Initialize progress
186
  if progress_callback:
@@ -218,9 +222,6 @@ Add this to your requirements.txt and redeploy the space."""
218
  log_queue.put(f"⚠️ Warning: Missing MinGW components: {', '.join(missing_mingw)}\n")
219
  log_queue.put("Windows cross-compilation may fail without proper MinGW-w64 installation\n")
220
 
221
- # Check Nuitka version
222
- nuitka_version = get_nuitka_version()
223
-
224
  # Check if static libpython is available
225
  has_static_libpython = check_static_libpython()
226
 
@@ -471,9 +472,6 @@ Add this to your requirements.txt and redeploy the space."""
471
  if output_extension != ".exe":
472
  os.chmod(binary_path, 0o755)
473
 
474
- # Current Python version info
475
- current_python = get_current_python_version()
476
-
477
  # Build the result summary string
478
  static_status = "Yes" if has_static_libpython else "No"
479
  file_size = os.path.getsize(binary_path) / 1024
@@ -596,7 +594,7 @@ Add this to your requirements.txt and redeploy the space."""
596
 
597
  ## Environment Status:
598
  - **Nuitka Version**: {get_nuitka_version()}
599
- - **Python Version**: {get_current_python_version()}
600
  - **Working Directory**: {os.getcwd()}
601
 
602
  ## Troubleshooting Steps:
 
181
 
182
  def compile_with_nuitka(code, requirements, packages, compilation_mode, output_extension, log_queue, progress_callback=None):
183
  """Compile Python code with Nuitka"""
184
+ # Get version info at the beginning to avoid UnboundLocalError
185
+ current_python = get_current_python_version()
186
+ nuitka_version = get_nuitka_version()
187
+
188
  try:
189
  # Initialize progress
190
  if progress_callback:
 
222
  log_queue.put(f"⚠️ Warning: Missing MinGW components: {', '.join(missing_mingw)}\n")
223
  log_queue.put("Windows cross-compilation may fail without proper MinGW-w64 installation\n")
224
 
 
 
 
225
  # Check if static libpython is available
226
  has_static_libpython = check_static_libpython()
227
 
 
472
  if output_extension != ".exe":
473
  os.chmod(binary_path, 0o755)
474
 
 
 
 
475
  # Build the result summary string
476
  static_status = "Yes" if has_static_libpython else "No"
477
  file_size = os.path.getsize(binary_path) / 1024
 
594
 
595
  ## Environment Status:
596
  - **Nuitka Version**: {get_nuitka_version()}
597
+ - **Python Version**: {current_python}
598
  - **Working Directory**: {os.getcwd()}
599
 
600
  ## Troubleshooting Steps: