@@ -466,6 +466,9 @@ public void initialize(Python3Core core) {
466
466
builtinConstants .put ("ps1" , ">>> " );
467
467
// continue prompt for interactive shell
468
468
builtinConstants .put ("ps2" , "... " );
469
+ // CPython builds for distros report empty strings too, because they are built from
470
+ // tarballs, not git
471
+ builtinConstants .put ("_git" , factory .createTuple (new Object []{"graalpython" , "" , "" }));
469
472
470
473
super .initialize (core );
471
474
@@ -830,6 +833,33 @@ public static AuditNode create() {
830
833
}
831
834
}
832
835
836
+ @ Builtin (name = "audit" , minNumOfPositionalArgs = 1 , takesVarArgs = true , doc = "audit(event, *args)\n " +
837
+ "\n " +
838
+ "Passes the event to any audit hooks that are attached." )
839
+ @ GenerateNodeFactory
840
+ abstract static class SysAuditNode extends PythonBuiltinNode {
841
+ @ Specialization
842
+ @ SuppressWarnings ("unused" )
843
+ Object doAudit (VirtualFrame frame , Object [] args ) {
844
+ // TODO: Stub audit hooks implementation for PEP 578
845
+ return PNone .NONE ;
846
+ }
847
+ }
848
+
849
+ @ Builtin (name = "audithook" , minNumOfPositionalArgs = 1 , doc = "addaudithook($module, /, hook)\n " +
850
+ "--\n " +
851
+ "\n " +
852
+ "Adds a new audit hook callback." )
853
+ @ GenerateNodeFactory
854
+ abstract static class SysAuditHookNode extends PythonBuiltinNode {
855
+ @ Specialization
856
+ @ SuppressWarnings ("unused" )
857
+ Object doAudit (VirtualFrame frame , Object hook ) {
858
+ // TODO: Stub audit hooks implementation for PEP 578
859
+ return PNone .NONE ;
860
+ }
861
+ }
862
+
833
863
@ Builtin (name = "is_finalizing" )
834
864
@ GenerateNodeFactory
835
865
public abstract static class IsFinalizingNode extends PythonBuiltinNode {
0 commit comments