Skip to content

Commit 0128f82

Browse files
committed
Add stubs for PEP 578
1 parent 03eedd0 commit 0128f82

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

graalpython/lib-graalpython/_io.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright (c) 2017, 2018, Oracle and/or its affiliates.
2+
# Copyright (c) 2017, 2020, Oracle and/or its affiliates.
33
# Copyright (c) 2017, The PyPy Project
44
#
55
# The MIT License
@@ -545,6 +545,11 @@ def truncate(self, size=-1):
545545
sys.__stderr__ = sys.stderr
546546

547547

548+
# PEP 578 stub
549+
def open_code(path):
550+
return FileIO(path, 'rb')
551+
552+
548553
# ----------------------------------------------------------------------------------------------------------------------
549554
#
550555
# following definitions: patched in the __builtins_patches__ module

graalpython/lib-graalpython/sys.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -139,6 +139,15 @@ def make_hash_info_class():
139139
# continue prompt for interactive shell
140140
ps2 = "... "
141141

142+
pycache_prefix = None
143+
144+
# Stub audit hooks implementation for PEP 578
145+
def audit(str, *args):
146+
pass
147+
148+
def addaudithook(hook):
149+
pass
150+
142151

143152
@__builtin__
144153
def exit(arg=0):

0 commit comments

Comments
 (0)