當前位置: 首頁>>代碼示例>>Python>>正文


Python lang.IllegalArgumentException方法代碼示例

本文整理匯總了Python中java.lang.IllegalArgumentException方法的典型用法代碼示例。如果您正苦於以下問題:Python lang.IllegalArgumentException方法的具體用法?Python lang.IllegalArgumentException怎麽用?Python lang.IllegalArgumentException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.lang的用法示例。


在下文中一共展示了lang.IllegalArgumentException方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_catch

# 需要導入模塊: from java import lang [as 別名]
# 或者: from java.lang import IllegalArgumentException [as 別名]
def test_catch(self):
        from java.lang import Integer
        from java.lang import RuntimeException, IllegalArgumentException, NumberFormatException
        with self.assertRaises(NumberFormatException):      # Actual class
            Integer.parseInt("hello")
        with self.assertRaises(IllegalArgumentException):   # Parent class
            Integer.parseInt("hello")
        with self.assertRaises(RuntimeException):           # Grandparent class
            Integer.parseInt("hello")

        from java.lang import System
        from java.io import IOException
        try:
            System.getProperty("")
        except IOException:                                 # Unrelated class
            self.fail()
        except NumberFormatException:                       # Child class
            self.fail()
        except IllegalArgumentException:                    # Actual class
            pass 
開發者ID:chaquo,項目名稱:chaquopy,代碼行數:22,代碼來源:test_exception.py

示例2: ask_sig

# 需要導入模塊: from java import lang [as 別名]
# 或者: from java.lang import IllegalArgumentException [as 別名]
def ask_sig():
	try:
		filepath = askFile("Choose Sig file:", "ApplySig").toString()
		print('Load File:' + filepath)
		return open(filepath, 'rb')
	except IllegalArgumentException as error:
		Msg.warn(self, error.toString())
	except ghidra.util.exception.CancelledException:
		print("User Cancelled") 
開發者ID:NWMonster,項目名稱:ApplySig,代碼行數:11,代碼來源:ApplySig.py

示例3: read_jython_code

# 需要導入模塊: from java import lang [as 別名]
# 或者: from java.lang import IllegalArgumentException [as 別名]
def read_jython_code(fullname, stream, filename):
    try:
        data = _imp.readCode(filename, stream, False)
        return BytecodeLoader.makeCode(fullname + "$py", data, filename)
    except IllegalArgumentException:
        return None 
開發者ID:Acmesec,項目名稱:CTFCrackTools-V2,代碼行數:8,代碼來源:pkgutil.py

示例4: load_cert_chain

# 需要導入模塊: from java import lang [as 別名]
# 或者: from java.lang import IllegalArgumentException [as 別名]
def load_cert_chain(self, certfile, keyfile=None, password=None):
        try:
            self._key_managers = _get_openssl_key_manager(certfile, keyfile, password, _key_store=self._key_store)
        except IllegalArgumentException as err:
            raise SSLError(SSL_ERROR_SSL, "PEM lib ({})".format(err)) 
開發者ID:Acmesec,項目名稱:CTFCrackTools-V2,代碼行數:7,代碼來源:ssl.py

示例5: _init_signals

# 需要導入模塊: from java import lang [as 別名]
# 或者: from java.lang import IllegalArgumentException [as 別名]
def _init_signals():
    # install signals by checking for standard names
    # using IllegalArgumentException to diagnose

    possible_signals = """
        SIGABRT
        SIGALRM
        SIGBUS
        SIGCHLD
        SIGCONT
        SIGFPE
        SIGHUP
        SIGILL
        SIGINFO
        SIGINT
        SIGIOT
        SIGKILL
        SIGPIPE
        SIGPOLL
        SIGPROF
        SIGQUIT
        SIGSEGV
        SIGSTOP
        SIGSYS
        SIGTERM
        SIGTRAP
        SIGTSTP
        SIGTTIN
        SIGTTOU
        SIGURG
        SIGUSR1
        SIGUSR2
        SIGVTALRM
        SIGWINCH
        SIGXCPU
        SIGXFSZ
    """.split()

    _module = __import__(__name__)
    signals = {}
    signals_by_name = {}
    for signal_name in possible_signals:
        try:
            java_signal = sun.misc.Signal(signal_name[3:])
        except IllegalArgumentException:
            continue

        signal_number = java_signal.getNumber()
        signals[signal_number] = java_signal
        signals_by_name[signal_name] = java_signal
        setattr(_module, signal_name, signal_number) # install as a module constant
    return signals 
開發者ID:ofermend,項目名稱:medicare-demo,代碼行數:54,代碼來源:signal.py


注:本文中的java.lang.IllegalArgumentException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。