From ea9061ccf55c6686cbe9b3c5223371d2a2e429ea Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 16 Nov 2018 08:32:25 +0100 Subject: [PATCH] Import urllib2 python agnostic --- ReviewBot.py | 19 ++++++++++++------- ToolBase.py | 9 +++++++-- abichecker/abichecker.py | 18 +++++++++++------- biarchtool.py | 15 +++++++++------ check_maintenance_incidents.py | 9 ++++++--- check_source.py | 13 +++++++++---- check_source_in_factory.py | 10 +++++++--- compare_pkglist.py | 9 +++++++-- fcc_submitter.py | 18 ++++++++++++------ leaper.py | 11 ++++++++--- legal-auto.py | 9 +++++++-- manager_42.py | 21 +++++++++++++-------- obs_clone.py | 8 +++++++- osclib/cache.py | 4 ++-- osclib/cycle.py | 9 +++++++-- osclib/prio_command.py | 4 ++-- osclib/repair_command.py | 4 ++-- rabbit-openqa.py | 2 +- suppkg_rebuild.py | 9 +++++++-- tests/obs.py | 9 +++++++-- totest-manager.py | 10 ++++++++-- update_crawler.py | 13 +++++++++---- 22 files changed, 160 insertions(+), 73 deletions(-) diff --git a/ReviewBot.py b/ReviewBot.py index dc0d754a..4db7e5f9 100644 --- a/ReviewBot.py +++ b/ReviewBot.py @@ -28,7 +28,12 @@ except ImportError: from osc import conf import osc.core -import urllib2 +try: + from urllib.error import HTTPError, URLError +except ImportError: + # python 2.x + from urllib2 import HTTPError, URLError + from itertools import count class PackageLookup(object): @@ -57,7 +62,7 @@ class PackageLookup(object): try: return osc.core.http_GET(osc.core.makeurl(self.apiurl, ['source', prj, '00Meta', 'lookup.yml'])) - except urllib2.HTTPError as e: + except HTTPError as e: # in case the project doesn't exist yet (like sle update) if e.code != 404: raise e @@ -458,7 +463,7 @@ class ReviewBot(object): url = osc.core.makeurl(apiurl, ('source', project, package), query=query) try: return ET.parse(osc.core.http_GET(url)).getroot() - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): return None def get_originproject(self, project, package, rev=None): @@ -493,7 +498,7 @@ class ReviewBot(object): url = osc.core.makeurl(self.apiurl, ('source', src_project, src_package), query=query) try: root = ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError: + except HTTPError: return (None, None) if root is not None: @@ -521,7 +526,7 @@ class ReviewBot(object): return True if self.review_group and self._has_open_review_by(root, 'by_group', self.review_group): return True - except urllib2.HTTPError as e: + except HTTPError as e: print('ERROR in URL %s [%s]' % (url, e)) return False @@ -670,7 +675,7 @@ class ReviewBot(object): self.logger.debug("checking %s in %s"%(package, project)) try: si = osc.core.show_package_meta(self.apiurl, project, package) - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): si = None if si is None: self.logger.debug("new package") @@ -686,7 +691,7 @@ class ReviewBot(object): u = osc.core.makeurl(self.apiurl, [ 'source', project, package, '_history' ], { 'limit': history_limit }) try: r = osc.core.http_GET(u) - except urllib2.HTTPError as e: + except HTTPError as e: self.logger.debug("package has no history!?") return None diff --git a/ToolBase.py b/ToolBase.py index 04dacd5b..17fd3d30 100644 --- a/ToolBase.py +++ b/ToolBase.py @@ -8,7 +8,12 @@ import logging import signal import sys import time -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError import osc.conf import osc.core @@ -48,7 +53,7 @@ class ToolBase(object): def retried_GET(self, url): try: return http_GET(url) - except urllib2.HTTPError as e: + except HTTPError as e: if 500 <= e.code <= 599: print 'Retrying {}'.format(url) time.sleep(1) diff --git a/abichecker/abichecker.py b/abichecker/abichecker.py index dadc664f..3bb22e0c 100755 --- a/abichecker/abichecker.py +++ b/abichecker/abichecker.py @@ -24,7 +24,12 @@ import osc.conf import osc.core from osc.util.cpio import CpioRead -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import rpm from collections import namedtuple from osclib.pkgcache import PkgCache @@ -783,7 +788,7 @@ class ABIChecker(ReviewBot.ReviewBot): [ 'view=cpioheaders' ]) try: r = osc.core.http_GET(u) - except urllib2.HTTPError as e: + except HTTPError as e: raise FetchError('failed to fetch header information: %s'%e) tmpfile = NamedTemporaryFile(prefix="cpio-", delete=False) for chunk in r: @@ -813,7 +818,7 @@ class ABIChecker(ReviewBot.ReviewBot): url = osc.core.makeurl(self.apiurl, ('build', prj, repo, arch, pkg)) try: root = ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError: + except HTTPError: return None return dict([(node.attrib['filename'], node.attrib['mtime']) for node in root.findall('binary')]) @@ -828,7 +833,7 @@ class ABIChecker(ReviewBot.ReviewBot): 'srcmd5' : rev } url = osc.core.makeurl(self.apiurl, ('build', src_project, '_result'), query) return ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError as e: + except HTTPError as e: if e.code != 404: self.logger.error('ERROR in URL %s [%s]' % (url, e)) raise @@ -855,7 +860,7 @@ class ABIChecker(ReviewBot.ReviewBot): url = osc.core.makeurl(self.apiurl, ('source', project, '_meta')) try: root = ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError: + except HTTPError: return None repos = set() @@ -912,7 +917,7 @@ class ABIChecker(ReviewBot.ReviewBot): url = osc.core.makeurl(self.apiurl, ('source', src_project, '_meta')) try: root = ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError: + except HTTPError: return None # set of source repo name, target repo name, arch @@ -1087,4 +1092,3 @@ class CommandLineInterface(ReviewBot.CommandLineInterface): if __name__ == "__main__": app = CommandLineInterface() sys.exit( app.main() ) - diff --git a/biarchtool.py b/biarchtool.py index df7bb4ad..30c0f8d6 100755 --- a/biarchtool.py +++ b/biarchtool.py @@ -4,7 +4,11 @@ from xml.etree import cElementTree as ET import sys import cmdln import logging -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError import osc.core import ToolBase @@ -158,7 +162,7 @@ class BiArchTool(ToolBase.ToolBase): try: x = ET.fromstring(self.cached_GET(self.makeurl(['source', self.project, pkg, '_history'], {'rev': '1'}))) # catch deleted packages - except urllib2.HTTPError as e: + except HTTPError as e: if e.code == 404: continue raise e @@ -202,7 +206,7 @@ class BiArchTool(ToolBase.ToolBase): self.http_PUT(pkgmetaurl, data=ET.tostring(pkgmeta)) if self.caching: self._invalidate__cached_GET(pkgmetaurl) - except urllib2.HTTPError as e: + except HTTPError as e: logger.error('failed to update %s: %s', pkg, e) def add_explicit_disable(self, wipebinaries=False): @@ -242,7 +246,7 @@ class BiArchTool(ToolBase.ToolBase): 'cmd' : 'wipe', 'arch': self.arch, 'package' : pkg })) - except urllib2.HTTPError as e: + except HTTPError as e: logger.error('failed to update %s: %s', pkg, e) @@ -326,7 +330,7 @@ class BiArchTool(ToolBase.ToolBase): 'cmd' : 'wipe', 'arch': self.arch, 'package' : pkg })) - except urllib2.HTTPError as e: + except HTTPError as e: logger.error('failed to update %s: %s', pkg, e) class CommandLineInterface(ToolBase.CommandLineInterface): @@ -399,4 +403,3 @@ class CommandLineInterface(ToolBase.CommandLineInterface): if __name__ == "__main__": app = CommandLineInterface() sys.exit( app.main() ) - diff --git a/check_maintenance_incidents.py b/check_maintenance_incidents.py index 4c3964a4..05a61413 100755 --- a/check_maintenance_incidents.py +++ b/check_maintenance_incidents.py @@ -13,7 +13,11 @@ except ImportError: import osc.conf import osc.core -import urllib2 +try: + from urllib.error import HTTPError, URLError +except ImportError: + # python 2.x + from urllib2 import HTTPError, URLError import yaml from osclib.memoize import memoize @@ -56,7 +60,7 @@ class MaintenanceChecker(ReviewBot.ReviewBot): url = osc.core.makeurl(apiurl, ('source', project, '00Meta', 'lookup.yml')) try: return yaml.safe_load(osc.core.http_GET(url)) - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): return None # check if pkgname was submitted by the correct maintainer. If not, set @@ -165,4 +169,3 @@ if __name__ == "__main__": app = ReviewBot.CommandLineInterface() app.clazz = MaintenanceChecker sys.exit( app.main() ) - diff --git a/check_source.py b/check_source.py index eeae597e..18e11651 100755 --- a/check_source.py +++ b/check_source.py @@ -17,7 +17,12 @@ from osclib.conf import Config from osclib.core import devel_project_get from osclib.core import devel_project_fallback from osclib.core import group_members -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import ReviewBot from osclib.conf import str2bool @@ -124,7 +129,7 @@ class CheckSource(ReviewBot.ReviewBot): shutil.rmtree(os.path.join(target_package, '.osc')) os.rename(target_package, '_old') old_info = self.package_source_parse(target_project, target_package) - except urllib2.HTTPError: + except HTTPError: self.logger.error('failed to checkout %s/%s' % (target_project, target_package)) CheckSource.checkout_package(self.apiurl, source_project, source_package, revision=source_revision, @@ -218,7 +223,7 @@ class CheckSource(ReviewBot.ReviewBot): try: xml = ET.parse(osc.core.http_GET(url)).getroot() - except urllib2.HTTPError as e: + except HTTPError as e: self.logger.error('ERROR in URL %s [%s]' % (url, e)) return ret @@ -261,7 +266,7 @@ class CheckSource(ReviewBot.ReviewBot): try: result = osc.core.show_project_sourceinfo(self.apiurl, action.tgt_project, True, (action.tgt_package)) root = ET.fromstring(result) - except urllib2.HTTPError: + except HTTPError: return None # Decline the delete request if there is another delete/submit request against the same package diff --git a/check_source_in_factory.py b/check_source_in_factory.py index e90524c7..3a07ae54 100755 --- a/check_source_in_factory.py +++ b/check_source_in_factory.py @@ -13,7 +13,12 @@ except ImportError: import osc.conf import osc.core -import urllib2 +try: + from urllib.error import HTTPError, URLError +except ImportError: + # python 2.x + from urllib2 import HTTPError, URLError + import yaml import ReviewBot @@ -89,7 +94,7 @@ class FactorySourceChecker(ReviewBot.ReviewBot): sr = srprefix break requests = osc.core.get_request_list(apiurl, project, package, None, ['new', 'review'], 'submit') - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): self.logger.error("caught exception while checking %s/%s", project, package) return None @@ -169,4 +174,3 @@ class CommandLineInterface(ReviewBot.CommandLineInterface): if __name__ == "__main__": app = CommandLineInterface() sys.exit( app.main() ) - diff --git a/compare_pkglist.py b/compare_pkglist.py index 0dbcabd5..f4b0ebbe 100755 --- a/compare_pkglist.py +++ b/compare_pkglist.py @@ -3,7 +3,12 @@ import argparse import logging import sys -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import re from xml.etree import cElementTree as ET @@ -53,7 +58,7 @@ class CompareList(object): url = makeurl(self.apiurl, ['source', project, '_meta']) try: http_GET(url) - except urllib2.HTTPError: + except HTTPError: return False return True diff --git a/fcc_submitter.py b/fcc_submitter.py index ac45fe72..1f52c52c 100755 --- a/fcc_submitter.py +++ b/fcc_submitter.py @@ -3,7 +3,13 @@ import argparse import logging import sys -import urllib2 + +try: + from urllib.error import HTTPError, URLError +except ImportError: + # python 2.x + from urllib2 import HTTPError, URLError + import random import re from xml.etree import cElementTree as ET @@ -115,7 +121,7 @@ class FccFreezer(object): l = ET.tostring(flink) try: http_PUT(url, data=l) - except urllib2.HTTPError as e: + except HTTPError as e: raise e class FccSubmitter(object): @@ -159,7 +165,7 @@ class FccSubmitter(object): def get_link(self, project, package): try: link = http_GET(makeurl(self.apiurl, ['source', project, package, '_link'])).read() - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): return None return ET.fromstring(link) @@ -201,7 +207,7 @@ class FccSubmitter(object): try: logging.debug("Gathering package_meta %s/%s" % (tgt_project, tgt_package)) osc.core.show_package_meta(self.apiurl, tgt_project, tgt_package) - except (urllib2.HTTPError, urllib2.URLError): + except (HTTPError, URLError): return True return False @@ -222,7 +228,7 @@ class FccSubmitter(object): def check_multiple_specfiles(self, project, package): try: url = makeurl(self.apiurl, ['source', project, package], { 'expand': '1' } ) - except urllib2.HTTPError as e: + except HTTPError as e: if e.code == 404: return None raise e @@ -283,7 +289,7 @@ class FccSubmitter(object): url = makeurl(self.apiurl, ['source', project, package, '{}?expand=1'.format('fcc_skip_pkgs')]) try: return http_GET(url).read() - except urllib2.HTTPError: + except HTTPError: return '' def crawl(self): diff --git a/leaper.py b/leaper.py index 00fcd8a0..b67b22f6 100755 --- a/leaper.py +++ b/leaper.py @@ -16,7 +16,13 @@ except ImportError: import osc.core from osclib.conf import Config from osclib.core import devel_project_get -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import yaml import ReviewBot from check_source_in_factory import FactorySourceChecker @@ -64,7 +70,7 @@ class Leaper(ReviewBot.ReviewBot): root = ET.parse(osc.core.http_GET(osc.core.makeurl(self.apiurl, ['source', project], query=query))).getroot() packages = [i.get('name') for i in root.findall('entry')] - except urllib2.HTTPError as e: + except HTTPError as e: # in case the project doesn't exist yet (like sle update) if e.code != 404: raise e @@ -583,4 +589,3 @@ class CommandLineInterface(ReviewBot.CommandLineInterface): if __name__ == "__main__": app = CommandLineInterface() sys.exit( app.main() ) - diff --git a/legal-auto.py b/legal-auto.py index dc2b9798..c2dcf315 100755 --- a/legal-auto.py +++ b/legal-auto.py @@ -12,7 +12,12 @@ import cmdln import requests as REQ import json import time -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError try: from xml.etree import cElementTree as ET @@ -53,7 +58,7 @@ class LegalAuto(ReviewBot.ReviewBot): def retried_GET(self, url): try: return http_GET(url) - except urllib2.HTTPError, e: + except HTTPError, e: if 500 <= e.code <= 599: print 'Retrying {}'.format(url) time.sleep(1) diff --git a/manager_42.py b/manager_42.py index 504bbd56..be684f14 100755 --- a/manager_42.py +++ b/manager_42.py @@ -12,7 +12,13 @@ import osc.conf import osc.core from osc.core import get_commitlog from osc.core import get_request_list -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import subprocess import time import yaml @@ -86,7 +92,7 @@ class Manager42(object): self.lookup = {} try: self.lookup = yaml.safe_load(self._load_lookup_file(project)) - except urllib2.HTTPError as e: + except HTTPError as e: if e.code != 404: raise @@ -118,7 +124,7 @@ class Manager42(object): def retried_GET(self, url): try: return http_GET(url) - except urllib2.HTTPError as e: + except HTTPError as e: if 500 <= e.code <= 599: logger.warn('Retrying {}'.format(url)) time.sleep(1) @@ -135,7 +141,7 @@ class Manager42(object): query=query))) packages = [i.get('name') for i in root.findall('entry')] - except urllib2.HTTPError as e: + except HTTPError as e: if e.code == 404: logger.error("{}: {}".format(project, e)) packages = [] @@ -158,7 +164,7 @@ class Manager42(object): for package in sorted(packages): try: self.check_one_package(package) - except urllib2.HTTPError as e: + except HTTPError as e: logger.error("Failed to check {}: {}".format(package, e)) pass @@ -225,7 +231,7 @@ class Manager42(object): query['deleted'] = 1 return self.cached_GET(makeurl(self.apiurl, ['source', project, package, '_history'], query)) - except urllib2.HTTPError as e: + except HTTPError as e: if e.code == 404: return None raise @@ -360,7 +366,7 @@ class Manager42(object): try: link = self.cached_GET(makeurl(self.apiurl, ['source', project, package, '_link'])) - except urllib2.HTTPError: + except HTTPError: return None return ET.fromstring(link) @@ -430,4 +436,3 @@ if __name__ == '__main__': http_DELETE = dryrun('DELETE') sys.exit(main(args)) - diff --git a/obs_clone.py b/obs_clone.py index dd230387..4ec4b0e7 100755 --- a/obs_clone.py +++ b/obs_clone.py @@ -10,7 +10,13 @@ from osc.core import http_PUT from osc.core import makeurl from osc.core import show_upstream_rev from osclib.core import project_pseudometa_package -from urllib2 import HTTPError + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import argparse import osc.conf import sys diff --git a/osclib/cache.py b/osclib/cache.py index 5288d66b..4ea7a781 100644 --- a/osclib/cache.py +++ b/osclib/cache.py @@ -11,10 +11,10 @@ import sys try: from urllib.parse import unquote from urllib.parse import urlsplit, SplitResult - from urllib.request import URLError, HTTPError + from urllib.error import URLError, HTTPError from io import StringIO except ImportError: - #python 2.x + # python 2.x from urlparse import urlsplit, SplitResult from urllib import unquote from urllib2 import URLError, HTTPError diff --git a/osclib/cycle.py b/osclib/cycle.py index be79e2e5..6f1c35db 100644 --- a/osclib/cycle.py +++ b/osclib/cycle.py @@ -1,4 +1,9 @@ -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + from xml.etree import cElementTree as ET from osc.core import http_GET @@ -140,7 +145,7 @@ class CycleDetector(object): # print('Generating _builddepinfo for (%s, %s, %s)' % (project, repository, arch)) url = makeurl(self.apiurl, ['build/%s/%s/%s/_builddepinfo' % (project, repository, arch)]) root = http_GET(url).read() - except urllib2.HTTPError as e: + except HTTPError as e: print('ERROR in URL %s [%s]' % (url, e)) return root diff --git a/osclib/prio_command.py b/osclib/prio_command.py index b872aad4..57b448ba 100644 --- a/osclib/prio_command.py +++ b/osclib/prio_command.py @@ -4,9 +4,9 @@ import json import osc try: - from urllib.request import HTTPError + from urllib.error import HTTPError except ImportError: - #python 2.x + # python 2.x from urllib2 import HTTPError class PrioCommand(object): diff --git a/osclib/repair_command.py b/osclib/repair_command.py index 19a11c86..1d92654f 100644 --- a/osclib/repair_command.py +++ b/osclib/repair_command.py @@ -3,9 +3,9 @@ from __future__ import print_function import re try: - from urllib.request import HTTPError + from urllib.error import HTTPError except ImportError: - #python 2.x + # python 2.x from urllib2 import HTTPError from osc import oscerr diff --git a/rabbit-openqa.py b/rabbit-openqa.py index e1397ccb..d08ae476 100755 --- a/rabbit-openqa.py +++ b/rabbit-openqa.py @@ -19,7 +19,7 @@ try: from urllib.error import HTTPError, URLError from urllib.parse import quote_plus except ImportError: - #python 2.x + # python 2.x from urllib2 import HTTPError, URLError from urllib import quote_plus diff --git a/suppkg_rebuild.py b/suppkg_rebuild.py index 17efb317..4857b8c9 100755 --- a/suppkg_rebuild.py +++ b/suppkg_rebuild.py @@ -3,7 +3,12 @@ import argparse import logging import sys -import urllib2 +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import re import yaml from xml.etree import cElementTree as ET @@ -80,7 +85,7 @@ class StagingHelper(object): url = makeurl(self.apiurl, ['source', project, pkg], query=query) try: root = ET.parse(http_GET(url)).getroot() - except urllib2.HTTPError as e: + except HTTPError as e: if e.code == 404: continue raise diff --git a/tests/obs.py b/tests/obs.py index 1a4cf394..44b605b2 100644 --- a/tests/obs.py +++ b/tests/obs.py @@ -6,7 +6,12 @@ import re import string import time import urllib -import urllib2 +try: + from urllib.parse import unquote +except ImportError: + # python 2.x + from urllib import unquote + import urlparse import xml.etree.cElementTree as ET @@ -852,7 +857,7 @@ class OBS(object): @GET('/search/request') def search_request(self, request, uri, headers): """Return a search result for /search/request.""" - query = urllib2.unquote(urlparse.urlparse(uri).query) + query = unquote(urlparse.urlparse(uri).query) assert query in ( "match=state/@name='review'+and+review[@by_group='factory-staging'+and+@state='new']+and+(target[@project='openSUSE:Factory']+or+target[@project='openSUSE:Factory:NonFree'])", "match=state/@name='review'+and+review[@by_user='factory-repo-checker'+and+@state='new']+and+(target[@project='openSUSE:Factory']+or+target[@project='openSUSE:Factory:NonFree'])" diff --git a/totest-manager.py b/totest-manager.py index 4a679831..c669ec79 100755 --- a/totest-manager.py +++ b/totest-manager.py @@ -17,7 +17,13 @@ import json import os import re import sys -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import logging import signal import time @@ -101,7 +107,7 @@ class ToTestBase(object): url = self.api.makeurl(['build', project, self.product_repo, self.product_arch, product]) try: f = self.api.retried_GET(url) - except urllib2.HTTPError: + except HTTPError: return [] ret = [] diff --git a/update_crawler.py b/update_crawler.py index eaeb4bc1..df1c6b85 100755 --- a/update_crawler.py +++ b/update_crawler.py @@ -4,7 +4,13 @@ import argparse import itertools import logging import sys -import urllib2 + +try: + from urllib.error import HTTPError +except ImportError: + # python 2.x + from urllib2 import HTTPError + import time from xml.etree import cElementTree as ET @@ -79,7 +85,7 @@ class UpdateCrawler(object): def retried_GET(self, url): try: return http_GET(url) - except urllib2.HTTPError as e: + except HTTPError as e: if 500 <= e.code <= 599: print 'Retrying {}'.format(url) time.sleep(1) @@ -191,7 +197,7 @@ class UpdateCrawler(object): ))) if root.get('project') is None and root.get('cicount'): return True - except urllib2.HTTPError as err: + except HTTPError as err: # if there is no link, it can't be a link if err.code == 404: return False @@ -370,4 +376,3 @@ if __name__ == '__main__': http_DELETE = dryrun('DELETE') sys.exit(main(args)) -