Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 3145405

Browse files
committed
Made installing a bit easier by moving imports into the code
1 parent 3b8d728 commit 3145405

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ethereum/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# -*- coding: utf-8 -*-
22
# ############# version ##################
3-
from pkg_resources import get_distribution, DistributionNotFound
3+
try:
4+
from pkg_resources import get_distribution, DistributionNotFound
5+
except:
6+
DistributionNotFound = Exception
47
import os.path
58
import subprocess
69
import re

ethereum/pow/ethpow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from ethereum import utils
33
import time
44
import sys
5-
import sha3
65
import warnings
76
from collections import OrderedDict
87
from ethereum.slogging import get_logger
@@ -41,6 +40,7 @@
4140

4241

4342
def get_cache(block_number):
43+
import sha3
4444
while len(cache_seeds) <= block_number // EPOCH_LENGTH:
4545
cache_seeds.append(sha3.sha3_256(cache_seeds[-1]).digest())
4646
seed = cache_seeds[block_number // EPOCH_LENGTH]

ethereum/tools/testutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import json
55
from ethereum.utils import encode_hex, str_to_bytes
6-
import pytest
76

87
FILL = 1
98
VERIFY = 2
@@ -36,6 +35,7 @@ def run_abi_test(params, mode):
3635
}
3736

3837
def generate_test_params(testsource, metafunc, skip_func=None, exclude_func=None):
38+
import pytest
3939
if ['filename', 'testname', 'testdata'] != metafunc.fixturenames:
4040
return
4141

0 commit comments

Comments
 (0)