Skip to content

Commit

Permalink
bug fix for TempFolder()
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyphelan committed Nov 13, 2024
1 parent 6d0893f commit c6a318a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pathogenprofiler/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import sys
import os.path
from collections import defaultdict
import math
import re
import json
import csv
import subprocess as sp
from uuid import uuid4
import logging
Expand All @@ -14,6 +11,7 @@
from tqdm import tqdm
from glob import glob
from .models import GenomeRange
import shutil


tmp_prefix = str(uuid4())
Expand Down Expand Up @@ -80,7 +78,7 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, traceback):
"""Remove temporary files"""
logging.debug("Removing temporary folder: %s" % self.prefix)
os.rmdir(self.prefix)
shutil.rmtree(self.prefix)

def get_tmp_file(prefix=None):
"""Get a temporary file"""
Expand Down

0 comments on commit c6a318a

Please sign in to comment.