1. Holger Krekel
  2. apipkg
  3. Issues


Issue #2 resolved

Do not use type(sys)('hello') for compatibility with Jython

Arfrever Frehtes Taifersar Arahesis
created an issue

Some tests in test_apipkg.py use type(sys)('hello'), which does not work in Jython. I suggest to use type(os)('hello') or types.ModuleType('hello').

In Jython: {{{

import os, sys, types type(os) <type 'module'> type(sys) <type '<reflected field public org.python.core.PyObject org.python.core.PySystemState.name at 0x1>'> type(os)('hello') <module 'hello' (built-in)> type(sys)('hello') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: systemstate(): expected 0 args; got 1 types.ModuleType('hello') <module 'hello' (built-in)> }}}

Comments (1)

  1. Log in to comment