diff options
Diffstat (limited to 'cli/onionshare_cli/onionshare.py')
-rw-r--r-- | cli/onionshare_cli/onionshare.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/onionshare_cli/onionshare.py b/cli/onionshare_cli/onionshare.py index 4e34cf4b..e518d2fb 100644 --- a/cli/onionshare_cli/onionshare.py +++ b/cli/onionshare_cli/onionshare.py @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -import os, shutil +import os +import shutil from .common import AutoStopTimer @@ -57,7 +58,7 @@ class OnionShare(object): """ try: self.port = self.common.get_available_port(17600, 17650) - except: + except Exception: raise OSError("Cannot find an available OnionShare port") def start_onion_service(self, mode, mode_settings, await_publication=True): @@ -102,7 +103,7 @@ class OnionShare(object): os.remove(filename) elif os.path.isdir(filename): shutil.rmtree(filename) - except: + except Exception: # Don't crash if file is still in use pass self.cleanup_filenames = [] |