チェンジセット 21: camellia

差分発生行の前後
無視リスト:
コミット日時:
2006/05/14 01:32:29 (3 年前)
コミッタ:
sgk
ログメッセージ:

sys.modules[name] = modにより、モジュール自体を入れ替えるようにした。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • camellia/trunk/camellia.py

    r20 r21  
    3232''' 
    3333 
     34# 
     35# Try to import C version or Python version 
     36# 
    3437try: 
    35   from ccamellia import * 
     38  import ccamellia as mod 
    3639except: 
    37   from pycamellia import * 
     40  import pycamellia as mod 
     41 
     42
     43# Copy the __doc__ string above if the imported module doesn't have it. 
     44
     45import sys 
     46try: 
     47  if not mod.__doc__: 
     48    mod.__doc__ = __doc__ 
     49except: 
     50  setattr(mod, '__doc__', __doc__) 
     51 
     52
     53# Replace the module registration with the C or Python version. 
     54
     55sys.modules[__name__] = mod 
     56 
     57
     58# Delete unwanted variables. 
     59
     60del mod, sys