mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
fix singlefile extractor exception when result is none
This commit is contained in:
parent
29c7aa26bc
commit
774ce3fda7
2 changed files with 3 additions and 2 deletions
|
@ -94,6 +94,7 @@ def save_singlefile(link: Link, out_dir: Optional[Path]=None, timeout: int=TIMEO
|
||||||
status = 'failed'
|
status = 'failed'
|
||||||
# TODO: Make this prettier. This is necessary to run the command (escape JSON internal quotes).
|
# TODO: Make this prettier. This is necessary to run the command (escape JSON internal quotes).
|
||||||
cmd[2] = browser_args.replace('"', "\\\"")
|
cmd[2] = browser_args.replace('"', "\\\"")
|
||||||
|
if result:
|
||||||
err.hints = (result.stdout + result.stderr).decode().split('\n')
|
err.hints = (result.stdout + result.stderr).decode().split('\n')
|
||||||
output = err
|
output = err
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -143,7 +143,7 @@ def list_migrations(out_dir: Path=OUTPUT_DIR) -> List[Tuple[bool, str]]:
|
||||||
def apply_migrations(out_dir: Path=OUTPUT_DIR) -> List[str]:
|
def apply_migrations(out_dir: Path=OUTPUT_DIR) -> List[str]:
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
null, out = StringIO(), StringIO()
|
null, out = StringIO(), StringIO()
|
||||||
# call_command("makemigrations", interactive=False, stdout=null)
|
call_command("makemigrations", interactive=False, stdout=null)
|
||||||
call_command("migrate", interactive=False, stdout=out)
|
call_command("migrate", interactive=False, stdout=out)
|
||||||
out.seek(0)
|
out.seek(0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue