Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Product License - GraalVM Community Edition 23.0 Python Language
Component

This is a release of GraalVM Community Edition 20.0 Python Language Component.
This particular copy of the software is released under Universal Permissive
License (UPL) v. 1.0.
Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved
Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved

===========================================================================
Universal Permissive License v. 1.0.
Expand Down
24 changes: 17 additions & 7 deletions graalpython/com.oracle.graal.python.test/src/tests/test_builtin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Copyright (c) 2018, 2023, Oracle and/or its affiliates.
# Copyright (c) 2018, 2026, Oracle and/or its affiliates.
# Copyright (C) 1996-2020 Python Software Foundation
#
# Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2

import os
import subprocess
import sys
import tempfile
import unittest

class MyIndexable(object):
Expand Down Expand Up @@ -68,7 +71,7 @@ def test_chr(self):
self.assertEqual(chr(97), 'a')
self.assertEqual(chr(0xfff), '\u0fff')
self.assertEqual(chr(0xf0000), '\U000f0000')

def test_ord(self):
self.assertEqual(ord(' '), 32)
self.assertEqual(ord('a'), 97)
Expand All @@ -93,19 +96,26 @@ def test_min(self):

def test_sort_keyfunc(self):
lists = [[], [1], [1,2], [1,2,3], [1,3,2], [3,2,1], [9,3,8,1,7,9,3,6,7,8]]

for l in lists:
count = 0

def keyfunc(v):
nonlocal count
count += 1
return v

result = sorted(l, key = keyfunc)
self.assertEqual(len(l), count)
self.assertEqual(sorted(l), result)
count = 0
result = sorted(l, key = keyfunc, reverse = True)
self.assertEqual(len(l), count)
self.assertEqual(sorted(l, reverse = True), result)
self.assertEqual(sorted(l, reverse = True), result)

def test_license(self):
with tempfile.TemporaryDirectory() as tmpdir:
# Test that it can find the license even when ran outside of the distribution
license = subprocess.check_output([sys.executable, "-c", "print(license())"], cwd=tmpdir, text=True, input=("\n" * 100))
if sys.implementation.name == 'graalpy':
self.assertIn('Oracle', license)
9 changes: 5 additions & 4 deletions graalpython/lib-python/3/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,13 @@ def setcopyright():
here = getattr(sys, '_stdlib_dir', None)
if not here and hasattr(os, '__file__'):
here = os.path.dirname(os.__file__)
if here:
files.extend(["LICENSE.txt", "LICENSE"])
dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
# GraalPy change: use graalpy home
files.append("LICENSE.txt")
dirs.append(__graalpython__.home)
builtins.license = _sitebuiltins._Printer(
"license",
"See https://www.python.org/psf/license/",
# GraalPy change
"See the license file in the root of distribution",
files, dirs)


Expand Down
1 change: 1 addition & 0 deletions graalpython/lib-python/3/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ def test_sitecustomize_executed(self):
'need SSL support to download license')
@test.support.requires_resource('network')
@test.support.system_must_validate_cert
@test.support.impl_detail("CPython-specific", graalpy=False)
def test_license_exists_at_url(self):
# This test is a bit fragile since it depends on the format of the
# string displayed by license in the absence of a LICENSE file.
Expand Down
Loading