Skip to content

Commit

Permalink
compatibility fix for latest cython version, inspect.isfunction behav…
Browse files Browse the repository at this point in the history
…iour is different
  • Loading branch information
frabbit committed Mar 2, 2015
1 parent 0a21425 commit dda4aa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion genpy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,10 @@ module Generator = struct
","
in
let k_enc = Base64.str_encode k in
print ctx "%s\"%s\": open('%%s.%%s'%%(__file__,'%s'),'rb').read()" prefix (Ast.s_escape k) k_enc;
let slash_index = try (String.rindex ctx.com.file '/')+1 with Not_found -> 0 in
let len = String.length ctx.com.file - slash_index in
let file_name = String.sub ctx.com.file slash_index len in
print ctx "%s\"%s\": open('%%s.%%s'%%('%s','%s'),'rb').read()" prefix (Ast.s_escape k) file_name k_enc;
Std.output_file (ctx.com.file ^ "." ^ k_enc) v
) ctx.com.resources;
spr ctx "}"
Expand Down
2 changes: 1 addition & 1 deletion std/python/_std/Reflect.hx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Reflect {

public static function isFunction( f : Dynamic ) : Bool
{
return Inspect.isfunction(f) || Inspect.ismethod(f);
return Inspect.isfunction(f) || Inspect.ismethod(f) || Builtin.hasattr(f, "func_code");
}

public static function compare<T>( a : T, b : T ) : Int {
Expand Down

0 comments on commit dda4aa4

Please sign in to comment.