summaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/onionshare.py
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-08-20 14:43:21 -0700
committerGitHub <noreply@github.com>2021-08-20 14:43:21 -0700
commitb66e742bc20ae977232fc53f22d485c10173ac2f (patch)
treec6eb66c340c34b45bac5525350c5eb5c43fe33a6 /cli/onionshare_cli/onionshare.py
parent76104671c3eacbef53ad96fffd8a57512ab2d093 (diff)
parent02254b13bb4818745193092f2144fd83726d79e7 (diff)
downloadonionshare-b66e742bc20ae977232fc53f22d485c10173ac2f.tar.gz
onionshare-b66e742bc20ae977232fc53f22d485c10173ac2f.zip
Merge pull request #1395 from onionshare/developv2.3.3
Version 2.3.3, merge develop into stable
Diffstat (limited to 'cli/onionshare_cli/onionshare.py')
-rw-r--r--cli/onionshare_cli/onionshare.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/cli/onionshare_cli/onionshare.py b/cli/onionshare_cli/onionshare.py
index 30eae3f3..bd94100f 100644
--- a/cli/onionshare_cli/onionshare.py
+++ b/cli/onionshare_cli/onionshare.py
@@ -18,9 +18,7 @@ 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
-
-from . import common
+import os
from .common import AutoStopTimer
@@ -59,7 +57,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):
@@ -90,21 +88,3 @@ class OnionShare(object):
Stop the onion service
"""
self.onion.stop_onion_service(mode_settings)
-
- def cleanup(self):
- """
- Shut everything down and clean up temporary files, etc.
- """
- self.common.log("OnionShare", "cleanup")
-
- # Cleanup files
- try:
- for filename in self.cleanup_filenames:
- if os.path.isfile(filename):
- os.remove(filename)
- elif os.path.isdir(filename):
- shutil.rmtree(filename)
- except:
- # Don't crash if file is still in use
- pass
- self.cleanup_filenames = []