当前位置: 首页>>代码示例>>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;未经允许,请勿转载。